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

Erro TFS 1.0 Teleport

rodrilois

New Member
Joined
Jun 9, 2009
Messages
94
Reaction score
0
Zao the teleport does not work, and not of any error in console

<movement event="StepIn" actionid="7300" script="wrath/tpmuggy.lua" />

Code:
function onStepIn(cid, item, position, fromPosition)
    local newPosition = {x=33213, y=31067, z=9}
    local noPosition = {x=33137, y=31249, z=6}
        if getPlayerStorageValue(cid, 1) > 3 or getPlayerStorageValue(cid, 1) == 3 then
                doTeleportThing(cid, newPosition, TRUE)
        else
            doTeleportThing(cid, noPosition, TRUE)
    end
end
 
Make sure the player's 1 storage doesn't equal 1 or 2. Just to iterate

Code:
getPlayerStorageValue(cid, 1) > 3
means that it's checking if the player's "1" storage state is more than 3. Also, you could shorten this.

Code:
if (getPlayerStorageValue(cid, 1) => 3) then
is better. To elaborate, it means "if x player's "1" storage state is more than or equal to 3 then".


Also! A better solution could be:
Code:
function onStepIn(cid, item, position, fromPosition)
    local newPosition = {x=33213, y=31067, z=9}

        if getPlayerStorageValue(cid, 1) > 3 or getPlayerStorageValue(cid, 1) == 3 then
                doTeleportThing(cid, newPosition, TRUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are unable to use this portal.")
    end
end
 
Last edited:
try:
Code:
function onStepIn(cid, item, position, fromPosition)
    local newPosition = {x=33213, y=31067, z=9}
    local noPosition = {x=33137, y=31249, z=6}
        if getPlayerStorageValue(cid, 1) >= 3 then
                doTeleportThing(cid, newPosition, TRUE)
        else
            doTeleportThing(cid, noPosition, TRUE)
            doPlayerSendTextMessage(cid, 4, 'You dont have this storage')
    end
end
 
Back
Top