function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if(getPlayerSlotItem(cid, 2).itemid == 2196) and getPlayerSkullType(cid) >= 0 then
doCreatureSetDropLoot(cid, false)
doPlayerAddBlessing(cid, i)
end
return true
end
registerCreatureEvent(cid, "onPrepareDeath")
<event type="preparedeath" name="onPrepareDeath" event="script" value="preparedeath.lua"/>
local bless = {1, 2, 3, 4, 5}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if(getPlayerSlotItem(cid, 2).itemid == 2196) and getPlayerSkullType(cid) >= 0 then
doCreatureSetDropLoot(cid, false)
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
end
return true
end
Himii, doPlayerAddBlessing(cid, i) wont work :S Since there is nothing which define i.
LUA:local bless = {1, 2, 3, 4, 5} function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if(getPlayerSlotItem(cid, 2).itemid == 2196) and getPlayerSkullType(cid) >= 0 then doCreatureSetDropLoot(cid, false) for i = 1, table.maxn(bless) do doPlayerAddBlessing(cid, bless[i]) end end return true end