I need help with my function:
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
addhook("ms100", "maxmp_maxhp") function maxmp_maxhp() parse("setmaxhealth " .. id .. " " .. PLAYERS[id].MAXHP) <--- This doesn't work :/ if PLAYERS[id] and PLAYERS[id].tmp.hp > PLAYERS[id].MAXHP then PLAYERS[id].tmp.hp = PLAYERS[id].MAXHP end if PLAYERS[id] and PLAYERS[id].MP > PLAYERS[id].MAXMP then PLAYERS[id].MP = PLAYERS[id].MAXMP end end
1
2
3
2
3
parse("setmaxhealth " .. id .. " " .. PLAYERS[id].MAXHP) LUA ERROR: sys/lua/cs2dtibia/hooks.lua:3: attempt to index field '?' (a nil value)
Or have a other idea to save and load max hp/mp + make max hp?
edited 2×, last 07.04.14 04:11:35 pm