• 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!

Solved Creature Event onKill

Status
Not open for further replies.

boby psaico

Member
Joined
Oct 17, 2009
Messages
84
Reaction score
5
How to make an event where all players who attack certain monsters will win a storage?

My scripts isn't working:

Code:
function onKill(cid, target, lastHit)
    if getCreatureName(target) == "Jaul" and isMonster(target) and isPlayer(cid) then
        setPlayerStorageValue(target, 33000, 1)
    end
    return true
end

Only the last killer is earning the storage :/
 
This problem is solved.

Code:
function onDeath(cid, corpse, deathList)

  local damageMap = Creature(cid):getDamageMap()
  for creatureId, damage in pairs(damageMap) do
    local thing = Creature(creatureId)
    setPlayerStorageValue(creatureId, 33000, 1)
end
  return true
end
Credits for dalkon
Thanks for all :)
 
Code:
[23/01/2014 20:56:52] [Error - CreatureScript Interface]
[23/01/2014 20:56:52] data/creaturescripts/scripts/deathbc.lua:onDeath
[23/01/2014 20:56:52] Description:
[23/01/2014 20:56:52] data/creaturescripts/scripts/deathbc.lua:3: attempt to call global 'Creature' (a nil value)
[23/01/2014 20:56:52] stack traceback:
[23/01/2014 20:56:52]    data/creaturescripts/scripts/deathbc.lua:3: in function <data/creaturescripts/scripts/deathbc.lua:1>
 
Status
Not open for further replies.
Back
Top