• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Monk's Script [Sweddy]

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
I have a traning monk script but it spam in console every time 1 step in or step out dont know :O

Error

[09/07/2009 12:03:11] Lua Script Error: [Action Interface]
[09/07/2009 12:03:11] data/actions/scripts/booths/training/north.lua:eek:nUse

[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.lua:eek:nUse

[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
 
or not.. i tested this sweddy.net.. but he fixed this problem
btw i maybe can fix ^^ im a beginner scripter(need to train)
 
Hmm i have test some things and its like this

some go in , get kicked for botting or out tp'ed the monk are still in there and if a player go in there when the monks are there i get this error :S?
 
Hmm i have test some things and its like this

some go in , get kicked for botting or out tp'ed the monk are still in there and if a player go in there when the monks are there i get this error :S?

So check if there are monks inside before calling doSummonCreature also.
 
Back
Top