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

TELEPORT BUG!

Penthelisea

Member
Joined
Nov 13, 2011
Messages
61
Reaction score
16
Hello people,i have tfs 1.2 , i have a bug , only in console... in game work perfect , no have crash :/
this is script :

local tile_id = {x = 32874, y = 31575, z = 7}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if isPlayer(cid) and getPlayerLevel(cid) >= 100 and getPlayerLevel(cid) <= 150 then
doTeleportThing(cid, tile_id)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Only levels 100 -> 150 may enter this area!")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doTeleportThing(cid, fromPosition)
end
return true
end



and this on console:
 
Last edited:
Solution
E
something like this:
Lua:
function onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        return false
    end

    if creature:getLevel() >= 100 and creature:getLevel() <= 150 then
        creature:teleportTo(Position(32874, 31575, 7))
        return false
    else
        creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Only levels 100 -> 150 may enter this area!")
    end
    return true
end
something like this:
Lua:
function onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        return false
    end

    if creature:getLevel() >= 100 and creature:getLevel() <= 150 then
        creature:teleportTo(Position(32874, 31575, 7))
        return false
    else
        creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Only levels 100 -> 150 may enter this area!")
    end
    return true
end
 
Solution
Back
Top