I tryed to do a script:
When you kill a zombie(a player) it ads one more level to the hud text on your screen.
By searching on the forum i got this far:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
lvl = {} addhook("objectkill","hi") function hi(od,id) if object(od,"player") == 1 then msg("You have leveled up!") lvl[id]=lvl[id]+1 end end addhook("second","ih") function ih() for _,id in ipairs(player(0,"table")) do parse('hudtxt2 '..id..' 0 "Level: '..lvl[id]..'" 99 99 0') end end addhook("join","_join") function _join(id) lvl[id]=0 end
Then i tryed to change it to a player not an object(a zombie controlled by the computer).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
lvl = {} addhook("Killplayer","hi") function hi(od,id) if player(od,"player") =>1 then msg("You have leveled up!") lvl[id]=lvl[id]+1 end end addhook("second","ih") function ih() for _,id in ipairs(player(0,"table")) do parse('hudtxt2 '..id..' 0 "Level: '..lvl[id]..'" 99 99 0') end end addhook("join","_join") function _join(id) lvl[id]=0 end
But then: LUA ERROR: sys/lua/autorun/hudtxt.lua:5: 'then' expected near '='