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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function InitArray(m,val)
array={}
	for i=1,m do
	array[i]=val
	end
return array
end
if (race==nil) then race={} end
if (race.score) then race.score={} end
race.score=InitArray(32,0)
addhook("spawn","speed")
function speed(id)
	parse("speedmod "..id.." 100")
	showscore(id)
end
function showscore(id)
txt = ("score : "..race.score[id])
x = 15
y = 430
parse('hudtxt2 '..id..' 1 "'..txt..'" '..x..' '..y)
end
addhook("movetile","score")
function score(id,x,y)
xx=9 --change x
yy=9 --change y
	if x==xx and y==yy then
		race.score[id] = (race.score[id]+1)
		msg(player(id,"name").." won the race! @C")
		parse("restartround")
		showscore(id)
	end
end
addhook("leave","resetscore")
function resetscore(id)
	race.score[id] = 0
end