Lais Prad
Disgusting Scammer
- Joined
- Apr 12, 2017
- Messages
- 153
- Solutions
- 6
- Reaction score
- 15
I'm trying to make this, and check how many seconds left to enter:
tfs 1.3
tfs 1.3
Lua:
local FerumbrasStorage = {}
local FerumbrasxStorage = 1209600 -- em segundos
local FerumbrasRoom = {x = 33376, y = 32307, z = 14}
function onStepIn(cid, item, position, lastPosition)
local player = Player(cid)
local name = player:getName()
if not FerumbrasStorage[name] or FerumbrasStorage[name] <= os.time() then
FerumbrasStorage[name] = os.time() + FerumbrasxStorage
player:teleportTo(FerumbrasRoom)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
else
player:sendCancelMessage(string.format("Wait %d seconds to enter again.", math.ceil(os.time()/1000)))
player:teleportTo(lastPosition) -- pra onde?
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
return true
end