• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lever which teleport you when item on position [sry for english]

  • Thread starter Thread starter tejdi
  • Start date Start date
T

tejdi

Guest
Hello again everybody.
Today i need help with script which will teleport player if "x" item is on position and remove it.

Code:
Additional information:
lever id: 1945 and 1946
action id: 3005
item id: 2696
item position: 1116, 953, 6
lever position: 1115, 953, 6
teleport to: 1113, 954, 5

PS
I'm creating server for otland [i will share data] with somethink other than we have here, but i'm not scripter and i can do only some things. TFS 1.0 is really strange for me.
I've done 4 fully scripted islands already.
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)
    Item(item.uid):transform(item.itemid == 1945 and 1946 or 1945)

    if item.itemid ~= 1945 then
        return true
    end

    local cheeseItem = Tile(Position(1116, 953, 6)):getItemById(2696)
    if cheeseItem then
        cheeseItem:remove()
       
        local player, destination = Player(cid), Position(1113, 954, 5)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        player:teleportTo(destination)
        destination:sendMagicEffect(CONST_ME_TELEPORT)
    end

    return true
end
 
Back
Top