president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
Hi everyone, the main idea of this script is when the bosses die then it should set gamestorage to 0, but isn't working, and doesn't get any error.
xml
Already registred bossesDeath in login.lua
monsters.xml
Thanks.
Code:
local config = {
["ferumbras"] = {storageKey = Storage.Bosses.Ferumbras, name = 'Ferumbras'},
["morgaroth"] = {storageKey = Storage.Bosses.Morgaroth, name = 'Morgaroth'},
["ghazbaran"] = {storageKey = Storage.Bosses.Ghazbaran, name = 'Ghazbaran'},
["orshabaal"] = {storageKey = Storage.Bosses.Orshabaal, name = 'Orshabaal'},
["zulazza"] = {storageKey = Storage.Bosses.Zulazza, name = 'Zulazza'}
}
function onKill(creature, target)
local monster = config[target:getName():lower()]
if not monster or target:isPlayer() then
return true
end
Game.setStorageValue(monster.storageKey, 0)
Game.broadcastMessage("Will not be allowed to enter on "..monster.name.."'s lair anymore due to even be dead.", MESSAGE_STATUS_WARNING)
return true
end
xml
Code:
<event type="kill" name="bossesDeath" script="others/bossesDeath.lua"/>
Already registred bossesDeath in login.lua
monsters.xml
Code:
<script>
<event name="bossesDeath"/>
</script>
Thanks.