• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

onPrepareDeath null vars

putamerda

New Member
Joined
Jan 2, 2012
Messages
73
Reaction score
0
Hello guys, i have an TFS 0.3.6 8.6
And i have an creaturescripts with event preparedeath
Everything works right
creaturescripts.xml
Code:
<event type="preparedeath" name="Arenadeath" event="script" value="arenadeath.lua"/>
arenadeath.lua
Code:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

local area = {x = 32349, y = 32257, z = 9}
local area2 = {x = 32352, y = 32259, z = 9}

if isInArea(getCreaturePosition(cid), area, area2) then
doCreatureSetDropLoot(cid, false)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) + 65500, true)
doTeleportThing(cid, {x = 32345, y = 32255, z =9})
doPlayerSendTextMessage(cid, 27, "Você perdeu!")
doTeleportThing(lastHitKiller, {x = 32356, y = 32255, z =9})
doPlayerSendTextMessage(lastHitKiller, 27, "Parabens, você ganhou!")
end
return true
end

the problemn is lastHitKiller and mostDamageKiller is null on arenadeath.lua, they are simply empty, what is wrong?
 
Back
Top