basing on Point[id] ?
Forum
Scripts
High Point Check
High Point Check
1 reply
1

basing on Point[id] ?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
addhook("second","_second")
function _second()
	local tmp,tmp2=greatestScore()
	if #tmp2==1 then
		msg(player(tmp2[1],"name").." has the greatest score. ("..tmp..")")
	else
		msg("There are "..#tmp2.." people with the greatest score of "..tmp..".")
		for _,id in ipairs(tmp2) do
			msg("-- "..player(id,"name").." --")
		end
	end
end
function greatestScore()
	local tmp={}
	local tmp2={}
	for _,id in ipairs(player(0,"table")) do
		table.insert(tmp,player(id,"score"))
	end
	for _,id in ipairs(player(0,"table")) do
		if math.max(unpack(tmp))==player(id,"score") then
			table.insert(tmp2,id)
		end
	end
	return math.max(unpack(tmp)),tmp2
end
greatestScore() returns 2 values:
the greatest score and a table of the people who have this score
In this example: every second will message the people with the greatest score.
1

Offline