anybody can help me? whats wrong?
Here is my first scripts:
data\creaturescripts\scripts\onadvancevoc.lua
data\creaturescripts\creaturescripts.xml
data\creaturescripts\scripts\login.lua
When i take level 8, my cpu usage is ~100%, server frezee,all what i can do, reboot computer.
Then I tryed to make other one which create a teleport when somebody takes level8, but is it very stupied, becouse my rook is full of teleports ;\
Can anybody look whats wrong with first script? or maybe say me how can I delete used teleports in second script?
thanks ;D
Here is my first scripts:
data\creaturescripts\scripts\onadvancevoc.lua
PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
if skill == SKILL__LEVEL and newlevel == 8 then
local oracleCords = {x=47, y=91, z=13}
local ppos = getPlayerPosition(cid)
if getPlayerVocation(cid) == 0 then
doTeleportThing(cid, oracleCords)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You can now pick a vocation! ")
end
end
end
data\creaturescripts\creaturescripts.xml
PHP:
<creaturescripts>
<event type="login" name="PlayerLogin" script="login.lua"/>
<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
<event type="advance" name="onadvancevoc" script="onadvancevoc.lua" />
</creaturescripts>
data\creaturescripts\scripts\login.lua
PHP:
function onLogin(cid)
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "onadvancevoc")
return TRUE
end
When i take level 8, my cpu usage is ~100%, server frezee,all what i can do, reboot computer.
Then I tryed to make other one which create a teleport when somebody takes level8, but is it very stupied, becouse my rook is full of teleports ;\
Can anybody look whats wrong with first script? or maybe say me how can I delete used teleports in second script?
thanks ;D