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

looking for action tfs 1.2

gubbo123

New Member
Joined
Aug 15, 2017
Messages
151
Solutions
1
Reaction score
3
Hello guys, i need a help...

i'm looking for a simple action...

If i use a lever ItemID: [2773] then the lever transform to ItemID: [2772]
and will create a drawbridge ItemID: [1771] in positions above

Position: [X: 32426] [Y: 32201] [Z: 14].
Position: [X: 32427] [Y: 32201] [Z: 14].
Position: [X: 32426] [Y: 32202] [Z: 14].
Position: [X: 32427] [Y: 32202] [Z: 14].

but i can use the lever one time just. i can't close the bridge again...
 
Solution
As you don't specify if it should not be used again for that player using or for all players, I made a simple script for create the bridge on first use.
It will transform to 2772. So just put the script to 2773 and it will be the one that works. Also to not mess with others levers you should set the position at the top of script to be the position of lever on map. This will prevent to create the dawnbridge everytime some lever is used. And also is more simple than add the actionId on map.

LUA:
local position = Position(x,y,z) -- Edit to the lever position on map

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getPosition() ~= position then
        return true
    end

    for x = 32426, 32427 do...
As you don't specify if it should not be used again for that player using or for all players, I made a simple script for create the bridge on first use.
It will transform to 2772. So just put the script to 2773 and it will be the one that works. Also to not mess with others levers you should set the position at the top of script to be the position of lever on map. This will prevent to create the dawnbridge everytime some lever is used. And also is more simple than add the actionId on map.

LUA:
local position = Position(x,y,z) -- Edit to the lever position on map

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getPosition() ~= position then
        return true
    end

    for x = 32426, 32427 do
        for y = 32201, 32202 do
            local tile = Tile(Position(x, y, 14))
            if tile or Game.createItem(1771, 1, tile:getPosition()) then
                return false
            end
        end
    end

    item:transform(2772)
    return true
end
 
Last edited:
Solution
Back
Top