So I'm having a quite annoying bug with this creaturescript. The script is suppose to remove a stone when a creature called Murrivel dies. One minute later the stone should be added again.
When I kill murrivel however the stone aint removed. And I get no error...
Here is the script
data/creaturescripts/creaturescripts.xml
data/creaturescripts/scripts/murrivel.lua
Inside login.lua I added this line
and finally inside murrivel.xml (the monster file) i added this
If anyone got a solution I deeply appreciate it!
thank you
//Massen
When I kill murrivel however the stone aint removed. And I get no error...
Here is the script
data/creaturescripts/creaturescripts.xml
Code:
<event type="kill" name="MurrivelStorage" script="murrivel.lua"/>
data/creaturescripts/scripts/murrivel.lua
Lua:
function onKill(cid, target)
local monster = getCreatureName(target)
local timeLimit = 1000 * 60 * 2 -- 2 minutes for the stone to move back.
local stonePosition = {x=1030, y=1133, z=4, stackpos=1}
local stone = getThingfromPos(stonePosition)
if (monster == "Murrivel") then
itemId = stone.itemid
doRemoveItem(stone.uid, 1)
doSendMagicEffect(stonePosition, 13)
addEvent(moveStone, timeLimit, {stone.uid == stone.uid})
end
return TRUE
end
function moveStone(timeLimit)
if getPlayerPosition(cid) == stonePosition then
doMoveCreature(cid, 2)
end
doSendMagicEffect(stonePosition, 13)
doCreateItem(itemId, 1, stonePosition)
return TRUE
end
Inside login.lua I added this line
Code:
registerCreatureEvent(cid, "MurrivelStorage")
Code:
<script>
<event name="MurrivelStorage"/>
</script>
thank you
//Massen
Last edited: