Hello guys, today i got a strange problem, i have made a simple dragon task, but it simple don't want to work, i already have done another creature script an works fine, i think that this should be fine too, check it out
dragontask.lua
creaturescripts.xml
login.lua
The creature event "killamalus" works perfectly, but when i kill some dragon it simply don't work, and i have all the storages and all that, i already test changing the script to a simple message and it don't show me too (that means that when i kill the dragon the script is never executed)
dragontask.lua
Code:
function onKill(cid, target)
if getPlayerStorageValue(cid, 18001) == 5 then
setPlayerStorageValue(cid, 17012, 19)
end
if getCreatureName(target) == "Dragon" then
if getPlayerStorageValue(cid, 18000) == 1 then
if getPlayerStorageValue(cid, 18001) <= 4 then
setPlayerStorageValue(cid, 18001, getPlayerStorageValue(cid, 18001)+1)
doPlayerSendTextMessage(cid, 24, "You have killed " .. getPlayerStorageValue(cid, 18001) .. " of 5 dragons")
end
end
end
return true
end
creaturescripts.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="login" name="PlayerLogin" script="login.lua"/>
<event type="login" name="FirstItems" script="firstitems.lua"/>
<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
<event type="kill" name="dragontask" script="dragontask.lua"/>
<event type="kill" name="killamalus" script="amalus.lua"/>
</creaturescripts>
login.lua
Code:
function onLogin(cid)
local storage = 5001
local message = [[Welcome to RonWorld!
Here are some commands that you will need:
- !buypremium = 10k for 30 days
- !promotion = 20k for a promotion
- !cd = Check Your cooldown spells
- Protection level = 30
- !help = see this again
Any dude talk in HELP CHANNEL
Enjoy your stay.]]
if getPlayerStorageValue(cid, storage) == -1 then
doPlayerPopupFYI(cid, message)
doPlayerAddSoul(cid, 100)
doPlayerAddItem(cid, 2120, 1)
doPlayerAddItem(cid, 2554, 1)
setPlayerStorageValue(cid, storage, 1)
end
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "dragontask")
registerCreatureEvent(cid, "killamalus")
return TRUE
end
The creature event "killamalus" works perfectly, but when i kill some dragon it simply don't work, and i have all the storages and all that, i already test changing the script to a simple message and it don't show me too (that means that when i kill the dragon the script is never executed)