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

TFS 0.X Moveevents Teleport with exhaust

Varianek

New Member
Joined
Nov 4, 2020
Messages
16
Reaction score
2
Hi, I need help with this script. I plan to add to this script exhaust but I don't know how add.

The script teleport players to pos xyz. If player come back too soon This player must wait xx minutes.

Lua:
function onStepIn(cid, item, pos)
local pos = {x=148, y=379, z=7}
doPlayerSendTextMessage(cid,22,"Next step.")
doTeleportThing(cid,pos)

doPlayerSendTextMessage(cid,22,"Teleport is closed to you. You must wait 2 minutes.")
end
 
Solution
Lua:
local config = {
    storage = 1000,
    time = 2,
    position = {x=148, y=379, z=7}
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if getPlayerStorageValue(cid, config.storage) - os.time() > 1 then
        doPlayerSendTextMessage(cid, 22, "Teleport is closed to you. You must wait "..config.time.." minutes.")
        return doTeleportThing(cid, fromPosition)
    end
    setPlayerStorageValue(cid, config.storage, os.time() + config.time * 60)
    doPlayerSendTextMessage(cid, 22, "Next step.")
    doTeleportThing(cid, config.position)
    return true
end
Lua:
local config = {
    storage = 1000,
    time = 2,
    position = {x=148, y=379, z=7}
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if getPlayerStorageValue(cid, config.storage) - os.time() > 1 then
        doPlayerSendTextMessage(cid, 22, "Teleport is closed to you. You must wait "..config.time.." minutes.")
        return doTeleportThing(cid, fromPosition)
    end
    setPlayerStorageValue(cid, config.storage, os.time() + config.time * 60)
    doPlayerSendTextMessage(cid, 22, "Next step.")
    doTeleportThing(cid, config.position)
    return true
end
 
Last edited:
Solution
Lua:
local config = {
    storage = 1000,
    time = 2,
    position = {x=148, y=379, z=7}
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if getPlayerStorageValue(cid, config.storage) - os.time() > 1 then
        doPlayerSendTextMessage(cid, 22, "Teleport is closed to you. You must wait "..config.time.." minutes.")
        return doTeleportThing(cid, fromPosition)
    end
    setPlayerStorageValue(cid, config.storage, os.time() + config.time * 60)
    doPlayerSendTextMessage(cid, 22, "Next step.")
    doTeleportThing(cid, config.position)
    return true
end
Thank You Bro.
 
Back
Top