I know function onKill(cid, target, lastHit), but it will give storage only for person who made last damage and here is the problem ;s
function onDeath(cid, corpse, killers)
<script>
<event name="eventname"/>
</script>
function onDeath(cid, corpse, killers)
if getCreatureName(cid) == "Boss" then
doPlayerSetStorageValue(cid, 63536, 1)
end
return TRUE
end
registerCreatureEvent(cid, "Boss")
<event type="kill" name="Boss" event="script" value="boss.lua"/>
<script>
<event name="Boss"/>
</script>
[Warning - Monster::Monster] Unknown event name - Boss
function onKill(cid, target)
if (getCreatureName(target) == "Boss") then
setPlayerStorageValue(cid,63536,1)
end
return true
end
You cant use onKill because with onKill cid = killer, and there can't be multiple cids rewarded. You'll have to use onDeath and loop through the deathlist and reward themNow I don't see any errors in console, but it doesn't give storage, here is my boss.lua
LUA:function onKill(cid, target) if (getCreatureName(target) == "Boss") then setPlayerStorageValue(cid,63536,1) end return true end
function onDeath(cid, corpse, killer)
local monstName,Storage = "Boss",63536 -- monster name, storage
if isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower(monstName) then
doCreatureSay(cid, "you received a storage!", TALKTYPE_ORANGE_1)
if isInParty(killer[1]) == true then
local players = getPartyMembers(getPartyLeader(killer[1]))
for i, k in ipairs(players) do
setPlayerStorageValue(k, Storage, 1)
end
else
setPlayerStorageValue(killer[1], Storage, 1)
end
end
return true
end
<event type="death" name="StoraGe" event="script" value="StorageMonster.lua"/>
<script>
<event name="StoraGe"/>
</script>