Belfahar
New Member
- Joined
- Jul 21, 2016
- Messages
- 25
- Reaction score
- 3
Hello everyone!
The idea is that the player, when killing the Brokul, receives storage 640001 and each time he kills he receives the value +1 in this same storage. The message on the screen is just to confirm that the script works. But it is not working.
The idea is that the player, when killing the Brokul, receives storage 640001 and each time he kills he receives the value +1 in this same storage. The message on the screen is just to confirm that the script works. But it is not working.
Lua:
local killingBrokul = CreatureEvent("killingBrokul")
function onMonsterKill(player, monster)
local monsterName = monster:getName()
if monsterName == "Brokul" then
player:setStorageValue(640001, player:getStorageValue(640001) + 1)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You killed the boss Brokul.")
end
end
function onCreatureDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
if killer:isPlayer() then
onMonsterKill(killer, creature)
end
end
function onStartup()
registerCreatureEvent(CREATURE_EVENT_DEATH, "onCreatureDeath")
end
onStartup()
killingBrokul:register()