Teddy
SweStream.se
I have a traning monk script but it spam in console every time 1 step in or step out dont know :O
Error
Action script
1 of the script (North)
Error
[09/07/2009 12:03:11] Lua Script Error: [Action Interface]
[09/07/2009 12:03:11] data/actions/scripts/booths/training/north.luanUse
[09/07/2009 12:03:11] luaDoRemoveCreature(). Creature not found
[09/07/2009 12:03:11] Lua Script Error: [Action Interface]
[09/07/2009 12:03:11] data/actions/scripts/booths/training/north.luanUse
[09/07/2009 12:03:11] luaDoRemoveCreature(). Creature not found
Action script
<!-- Training Booths -->
<action actionid="9001" script="booths/training/north.lua" />
<action actionid="9002" script="booths/training/east.lua" />
<action actionid="9003" script="booths/training/south.lua" />
<action actionid="9004" script="booths/training/west.lua" />
1 of the script (North)
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
-- Define positions.
local charPos = getCreaturePosition(cid)
local doorPos = getThingPos(item.uid)
local monkOne = {x = doorPos.x - 1, y = doorPos.y - 2, z = doorPos.z}
local monkTwo = {x = doorPos.x + 1, y = doorPos.y - 2, z = doorPos.z}
local checkPlayer = {x = doorPos.x, y = doorPos.y - 1, z = doorPos.z, stackpos = 253}
-- Define directions.
local newDir = 0
local oldDir = 2
-- Check where the player is located at.
if ( charPos.y == doorPos.y + 1 and charPos.z == doorPos.z ) then
-- Check if someone already uses the training booth.
if isPlayer(getThingfromPos(checkPlayer).uid) == TRUE then
doPlayerSendTextMessage(cid, 24, "Someone is already using this booth.")
doSendMagicEffect(getCreaturePos(cid), 2)
else
-- Teleport player.
doTeleportThing(cid, doorPos)
doMoveCreature(cid, newDir)
-- Summon training monks.
doSummonCreature("Training Monk", monkOne)
doSummonCreature("Training Monk", monkTwo)
end
else
-- Teleport player.
doTeleportThing(cid, doorPos)
doMoveCreature(cid, oldDir)
-- Remove training monks.
doRemoveCreature(getThingfromPos({x = monkOne.x, y = monkOne.y, z = monkOne.z, stackpos = 253}).uid)
doRemoveCreature(getThingfromPos({x = monkTwo.x, y = monkTwo.y, z = monkTwo.z, stackpos = 253}).uid)
-- Send magic effect.
doSendMagicEffect(monkOne, 2)
doSendMagicEffect(monkTwo, 2)
end
return TRUE
end