TFS 1.3.10
Hello, to be honest I don't know how to add time to a lever
Lever ID 1945
Lever ID 1946
Magic field ID 1387
This lever starts as 1945 and when this 1946 appears the portal
Once in 1946, how do I add time limit for return to 1945?
lever.lua
sorry my bad english
Hello, to be honest I don't know how to add time to a lever
Lever ID 1945
Lever ID 1946
Magic field ID 1387
This lever starts as 1945 and when this 1946 appears the portal
Once in 1946, how do I add time limit for return to 1945?
lever.lua
Lua:
local t = {
Position(10002, 9027, 11), -- TP location
Position(9999, 9027, 12) -- Where the TP takes you
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 1945 then
local teleport = Game.createItem(1387, 1, t[1])
if teleport then
teleport:setDestination(t[2])
t[1]:sendMagicEffect(CONST_ME_TELEPORT)
end
elseif item.itemid == 1946 then
local tile = t[1]:getTile()
if tile then
local teleport = tile:getItemById(1387)
if teleport and teleport:isTeleport() then
teleport:remove()
end
end
end
return item:transform(item.itemid == 1945 and 1946 or 1945)
end
sorry my bad english
Last edited: