Searched a lot for this but didn't find something like this, so thought i'd share it now that I finally got it to work exactly as intended Big thanks to master @Xikini for helping and guiding me all the way.
So, basically it's a bridge with 12 squares and a lever on one side. Pull it once, the 12 squares disappears (turns into "Invisibile Blocking Item"/1548) and everything on the bridge gets teleported/Relocated to the south side of the bridge. The bridge is elevated 1 floor above ground and is made of the same tile we transform the "invisible blocking item" into when pulling the lever the second time(1284).
Update: To make it even more noobfriendly, it also needs to be understood that the lever you want to use for the bridge is given ActionId xxxx. And then make a new action in Actions/Actions.xml with the same "action-id" and linked to the location of the script you chose to use.. normally it'd probaby be Actions/Scripts/other/Bridge.lua
Feedback on script, presentation, etc, welcomed!
Bridge.lua
@Xikini made another script that worked just as well. If the first script doesn't work this might(If 1st is not working on another version of TFS or whatever problem you might have with it).
So, basically it's a bridge with 12 squares and a lever on one side. Pull it once, the 12 squares disappears (turns into "Invisibile Blocking Item"/1548) and everything on the bridge gets teleported/Relocated to the south side of the bridge. The bridge is elevated 1 floor above ground and is made of the same tile we transform the "invisible blocking item" into when pulling the lever the second time(1284).
Update: To make it even more noobfriendly, it also needs to be understood that the lever you want to use for the bridge is given ActionId xxxx. And then make a new action in Actions/Actions.xml with the same "action-id" and linked to the location of the script you chose to use.. normally it'd probaby be Actions/Scripts/other/Bridge.lua
Feedback on script, presentation, etc, welcomed!
Bridge.lua
Code:
function onUse(cid, item, topos, frompos)
local cfg = {
bridgePos = {x=1114, y=700, z=3, stackpos=0},
bridge2Pos = {x=1115, y=700, z=3, stackpos=0},
bridge3Pos = {x=1116, y=700, z=3, stackpos=0},
bridge4Pos = {x=1114, y=701, z=3, stackpos=0},
bridge5Pos = {x=1115, y=701, z=3, stackpos=0},
bridge6Pos = {x=1116, y=701, z=3, stackpos=0},
bridge7Pos = {x=1114, y=702, z=3, stackpos=0},
bridge8Pos = {x=1115, y=702, z=3, stackpos=0},
bridge9Pos = {x=1116, y=702, z=3, stackpos=0},
bridge10Pos = {x=1114, y=703, z=3, stackpos=0},
bridge11Pos = {x=1115, y=703, z=3, stackpos=0},
bridge12Pos = {x=1116, y=703, z=3, stackpos=0},
bridgePush = {x=1115, y=704, z=3},
-- Relocate creature/item to this Pos if it blocks BridgePos
}
if item.itemid == 9825 then
doTransformItem(getThingfromPos(cfg.bridgePos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge2Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge3Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge4Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge5Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge6Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge7Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge8Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge9Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge10Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge11Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge12Pos).uid, 1548)
doRelocate(cfg.bridgePos, cfg.bridgePush)
doRelocate(cfg.bridge2Pos, cfg.bridgePush)
doRelocate(cfg.bridge3Pos, cfg.bridgePush)
doRelocate(cfg.bridge4Pos, cfg.bridgePush)
doRelocate(cfg.bridge5Pos, cfg.bridgePush)
doRelocate(cfg.bridge6Pos, cfg.bridgePush)
doRelocate(cfg.bridge7Pos, cfg.bridgePush)
doRelocate(cfg.bridge8Pos, cfg.bridgePush)
doRelocate(cfg.bridge9Pos, cfg.bridgePush)
doRelocate(cfg.bridge10Pos, cfg.bridgePush)
doRelocate(cfg.bridge11Pos, cfg.bridgePush)
doRelocate(cfg.bridge12Pos, cfg.bridgePush)
doTransformItem(item.uid, 9826)
elseif item.itemid == 9826 then
doTransformItem(getThingfromPos(cfg.bridgePos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge2Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge3Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge4Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge5Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge6Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge7Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge8Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge9Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge10Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge11Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge12Pos).uid, 1284)
doTransformItem(item.uid, 9825)
end
return true
end
@Xikini made another script that worked just as well. If the first script doesn't work this might(If 1st is not working on another version of TFS or whatever problem you might have with it).
Code:
local cfg = {
bridgePos = {x = 1114, y = 700, z = 3, stackpos = 0},
bridge2Pos = {x = 1115, y = 700, z = 3, stackpos = 0},
bridge3Pos = {x = 1116, y = 700, z = 3, stackpos = 0},
bridge4Pos = {x = 1114, y = 701, z = 3, stackpos = 0},
bridge5Pos = {x = 1115, y = 701, z = 3, stackpos = 0},
bridge6Pos = {x = 1116, y = 701, z = 3, stackpos = 0},
bridge7Pos = {x = 1114, y = 702, z = 3, stackpos = 0},
bridge8Pos = {x = 1115, y = 702, z = 3, stackpos = 0},
bridge9Pos = {x = 1116, y = 702, z = 3, stackpos = 0},
bridge10Pos = {x = 1114, y = 703, z = 3, stackpos = 0},
bridge11Pos = {x = 1115, y = 703, z = 3, stackpos = 0},
bridge12Pos = {x = 1116, y = 703, z = 3, stackpos = 0},
bridgePush = {x = 1115, y = 704, z = 3} -- Relocate creature/item to this Pos if it blocks BridgePos
}
function onUse(cid, item, topos, frompos)
if item.itemid == 9825 then
-- relocate item/players
doRelocate(cfg.bridgePos, cfg.bridgePush)
doRelocate(cfg.bridge2Pos, cfg.bridgePush)
doRelocate(cfg.bridge3Pos, cfg.bridgePush)
doRelocate(cfg.bridge4Pos, cfg.bridgePush)
doRelocate(cfg.bridge5Pos, cfg.bridgePush)
doRelocate(cfg.bridge6Pos, cfg.bridgePush)
doRelocate(cfg.bridge7Pos, cfg.bridgePush)
doRelocate(cfg.bridge8Pos, cfg.bridgePush)
doRelocate(cfg.bridge9Pos, cfg.bridgePush)
doRelocate(cfg.bridge10Pos, cfg.bridgePush)
doRelocate(cfg.bridge11Pos, cfg.bridgePush)
doRelocate(cfg.bridge12Pos, cfg.bridgePush)
-- transform tiles to nothing
doTransformItem(getThingfromPos(cfg.bridgePos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge2Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge3Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge4Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge5Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge6Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge7Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge8Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge9Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge10Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge11Pos).uid, 1548)
doTransformItem(getThingfromPos(cfg.bridge12Pos).uid, 1548)
-- transform lever
doTransformItem(item.uid, 9826)
elseif item.itemid == 9826 then
-- transform tiles to bridge
doTransformItem(getThingfromPos(cfg.bridgePos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge2Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge3Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge4Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge5Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge6Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge7Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge8Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge9Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge10Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge11Pos).uid, 1284)
doTransformItem(getThingfromPos(cfg.bridge12Pos).uid, 1284)
-- transform lever
doTransformItem(item.uid, 9825)
end
return true
end
Last edited: