• 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!

Solved Lua Thing not found help please!

Nubaza

LUA Scripter
Joined
Jun 5, 2011
Messages
337
Solutions
1
Reaction score
23
Location
Chile
Error in movements script...

zombie.lua
LUA:
local config = {
    playerCount = 1560, -- Global storage for counting the players in the event
    maxPlayers = 100, -- Max players who can participate
    
    }
    
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if not isPlayer(cid) then
return doTeleportThing(getCreatureSummons(cid)[1], getThingPos(cid))
end
if getPlayerStorageValue(cid, 17001) == 1 then   
doPlayerSendTextMessage(cid, 27, "You can't enter when you are riding.")
return addEvent(tpBack, 100, cid, fromPosition)
end
if getPlayerStorageValue(cid, 17000) == 1 then 
doPlayerSendTextMessage(cid, 27, "You can't enter when you are flying.")
return addEvent(tpBack, 100, cid, fromPosition)
end
if #getCreatureSummons(cid) >= 1 then
doPlayerSendTextMessage(cid, 27, "You can't play the event with pokemons.")
return addEvent(tpBack, 100, cid, fromPosition) and doTeleportThing(getCreatureSummons(cid)[1], getThingPos(cid))
end
if getPlayerStorageValue(cid, 5700) == 1 then 
doPlayerSendTextMessage(cid, 27, "You can't enter when you are mounted in a bike.")
return addEvent(tpBack, 100, cid, fromPosition)
end
if getPlayerGroupId(cid) == 4 then 
doPlayerSendTextMessage(cid, 27, "The Gamemasters CANNOT enter to the events.")
return addEvent(tpBack, 100, cid, fromPosition)
end
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"You have entered the event! Wait begins the event.")
    if getGlobalStorageValue(config.playerCount) < config.maxPlayers then
        setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1)
        if getGlobalStorageValue(config.playerCount) == config.maxPlayers then
            doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(config.playerCount) .. " players]! The event will soon start.")
        else    
            doBroadcastMessage(getPlayerName(cid) .. " entered the Zombie event! Currently " .. getGlobalStorageValue(config.playerCount) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED)
        end    
    else
        addEvent(tpBack, 1000, cid, fromPosition)
        doPlayerSendCancel(cid, "The event is full. There is already " .. config.maxPlayers .. " players participating in the quest.")
        return false
    end
    print(getStorage(config.playerCount) .. " Players in the zombie event.")
    return true
end

function tpBack(cid, fromPosition)
    doTeleportThing(cid, fromPosition, true)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
end

tag

Code:
<movevent type="StepIn" actionid="1863" event="script" value="zombie.lua"/>

I get this error:

Code:
[02/08/2012 18:44:59] [Error - MoveEvents Interface] 
[02/08/2012 18:44:59] data/movements/scripts/zombie.lua:onStepIn
[02/08/2012 18:44:59] Description: 
[02/08/2012 18:44:59] (luaDoTeleportThing) Thing not found


Someone's can fix this?
Very thanks..!
 
Last edited:
It actually is the whole error.

@Topic:
Make a check before calling doTeleportThing to make sure that the thing is still in the game world, for example use isCreature/isPlayer functions.

He just added it because that was clearly not there before.
 
It's probably because you're trying to teleport something that is not found (check in your first if statement).
Such as a summoned monster. You didn't check if there's at least 1 summoned monster.
 
SOLVED

zombie.lua now:
LUA:
local config = {
    playerCount = 1560, -- Global storage for counting the players in the event
    maxPlayers = 100, -- Max players who can participate
    
    }

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if not isPlayer(cid) then
return true
end
if getPlayerStorageValue(cid, 17001) == 1 then   
doPlayerSendTextMessage(cid, 27, "You can't enter when you are riding.")
return addEvent(tpBack, 100, cid, fromPosition)
end
if getPlayerStorageValue(cid, 17000) == 1 then 
doPlayerSendTextMessage(cid, 27, "You can't enter when you are flying.")
return addEvent(tpBack, 100, cid, fromPosition)
end
if #getCreatureSummons(cid) >= 1 then
doPlayerSendTextMessage(cid, 27, "You can't play the event with pokemons.")
return addEvent(tpBack, 100, cid, fromPosition) and doTeleportThing(getCreatureSummons(cid)[1], getPlayerPosition(cid), true)
end
if getPlayerStorageValue(cid, 5700) == 1 then 
doPlayerSendTextMessage(cid, 27, "You can't enter when you are mounted in a bike.")
return addEvent(tpBack, 100, cid, fromPosition)
end
if getPlayerGroupId(cid) == 4 then 
doPlayerSendTextMessage(cid, 27, "The Gamemasters CANNOT enter to the events.")
return addEvent(tpBack, 100, cid, fromPosition)
end
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"You have entered the event! Wait begins the event.")
    if getGlobalStorageValue(config.playerCount) < config.maxPlayers then
        setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1)
        if getGlobalStorageValue(config.playerCount) == config.maxPlayers then
            doBroadcastMessage("The Zombie event is now full [" .. getGlobalStorageValue(config.playerCount) .. " players]! The event will soon start.")
        else    
            doBroadcastMessage(getPlayerName(cid) .. " entered the Zombie event! Currently " .. getGlobalStorageValue(config.playerCount) .. " players have joined!", MESSAGE_STATUS_CONSOLE_RED)
        end    
    else
        addEvent(tpBack, 1000, cid, fromPosition)
        doPlayerSendCancel(cid, "The event is full. There is already " .. config.maxPlayers .. " players participating in the quest.")
        return false
    end
    print(getStorage(config.playerCount) .. " Players in the zombie event.")
    return true
end

function tpBack(cid, fromPosition)
    doTeleportThing(cid, fromPosition, true)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
end

Soo.. i have edited:
LUA:
if not isPlayer(cid) then
return doTeleportThing(getCreatureSummons(cid)[1], getThingPos(cid))
end

for:
LUA:
if not isPlayer(cid) then
return true
end
 
Last edited:
XML:
<movevent type="StepIn" actionid="1863" event="script" value="tp.lua"/>

???

Set actionid in teleport.
 
Back
Top