local config = {
[9001] = {x = 94, y = 117, z = 7},
[9002] = {x = 94, y = 118, z = 7},
[9003] = {x = 94, y = 119, z = 7},
[9004] = {x = 94, y = 110, z = 7},
[9005] = {x = 94, y = 109, z = 7},
[9006] = {x = 94, y = 108, z = 7},
[9007] = {x = 94, y = 107, z = 7},
[9008] = {x = 94, y = 114, z = 7},
[9009] = {x = 94, y = 115, z = 7},
[9010] = {x = 94, y = 116, z = 7},
[9011] = {x = 94, y = 117, z = 7}
}
local storage = 9853
local time = 30 -- time in seconds
function onStepIn(cid, item, position, fromPosition)
if item.actionid == 0 or not config[item.uid] then
return true
end
if globalexhaustion.check(storage + item.actionid) then
doTeleportThing(cid, fromPosition)
doPlayerSendCancel(cid, "You need to wait "..globalexhaustion.get(storage + item.actionid).." seconds before you can enter here again.")
return true
end
doTeleportThing(cid, config[item.uid])
globalexhaustion.set(storage + item.actionid, time)
return true
end
local storage = 9853
local time = 300 -- time in seconds
local function denied(var)
doTeleportThing(var.cid, var.tp)
end
function onStepIn(cid, item, position, fromPosition)
if item.actionid == 0 then
return true
end
if globalexhaustion.check(storage + item.actionid) then
local var = {cid = cid, tp = fromPosition}
addEvent(denied, 0, var)
doPlayerSendCancel(cid, "You need to wait "..globalexhaustion.get(storage + item.actionid).." seconds before entering this instance.")
return true
end
globalexhaustion.set(storage + item.actionid, time)
return true
end
I did and nothing hsppens limos
You have to add the uniqueids to the teleports and the actionids, the teleports can't have a teleport position (so you can also just use ghost charms).Works fine for me, but you can also do it with the positions based on uniqueid in a table instead of in the teleports.
Code:local config = { [9001] = {x = 94, y = 117, z = 7}, [9002] = {x = 94, y = 118, z = 7}, [9003] = {x = 94, y = 119, z = 7}, [9004] = {x = 94, y = 110, z = 7}, [9005] = {x = 94, y = 109, z = 7}, [9006] = {x = 94, y = 108, z = 7}, [9007] = {x = 94, y = 107, z = 7}, [9008] = {x = 94, y = 114, z = 7}, [9009] = {x = 94, y = 115, z = 7}, [9010] = {x = 94, y = 116, z = 7}, [9011] = {x = 94, y = 117, z = 7} } local storage = 9853 local time = 30 -- time in seconds function onStepIn(cid, item, position, fromPosition) if item.actionid == 0 or not config[item.uid] then return true end if globalexhaustion.check(storage + item.actionid) then doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "You need to wait "..globalexhaustion.get(storage + item.actionid).." seconds before you can enter here again.") return true end doTeleportThing(cid, config[item.uid]) globalexhaustion.set(storage + item.actionid, time) return true end
<movevent type="StepIn" itemid="1387" event="script" value="exhausttel.lua"/>