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

Action Bridgelever

JayBeee

Retired Global Mod
Senator
Joined
Jun 2, 2007
Messages
5,224
Reaction score
13
Location
Sweden
I've made a script for making\removing a bridge.


Here's the script:

in bridgelever.lua:
Code:
--Script made by Empty
function onUse(cid, item, frompos, item2, topos)
    tile1 = {x=222, y=333, z=5, stackpos=1} --change tilepos
    tile2 = {x=222, y=332, z=5, stackpos=1} --change tilepos
    tile3 = {x=222, y=331, z=5, stackpos=1} --change tilepos
    gettile1 = getThingfromPos(tile1)
    gettile2 = getThingfromPos(tile2)
    gettile3 = getThingfromPos(tile3)

    if item.uid == 7007 and item.itemid == 1945 then
        doRemoveItem(gettile1.uid,1)
        doRemoveItem(gettile2.uid,1)
        doRemoveItem(gettile3.uid,1)
        doCreateItem(965,1,tile1)
        doCreateItem(965,1,tile2)
        doCreateItem(965,1,tile3)
        doTransformItem(item.uid,item.itemid+1)
    elseif item.uid == 7007 and item.itemid == 1946 then
        doCreateItem(100,1,tile1) --change itemID
        doCreateItem(100,1,tile2) --change itemID
        doCreateItem(100,1,tile3) --change itemID
        doRemoveItem(gettile1.uid,1)
        doRemoveItem(gettile2.uid,1)
        doRemoveItem(gettile3.uid,1)
        doTransformItem(item.uid,item.itemid-1)        
    else
        doPlayerSendCancel(cid,"Sorry, not possible.")
    end

    return 1
end
and in actions.xml
Code:
<action uniqueid="7007" script="bridgelever.lua" />
Hope it can help you. Oh almost forgot, its easy to change it to make a larger bridge, its just to add more tiles, like this:

Code:
--Script made by Empty
function onUse(cid, item, frompos, item2, topos)
    tile1 = {x=222, y=333, z=5, stackpos=1} --change tilepos
    tile2 = {x=222, y=332, z=5, stackpos=1} --change tilepos
    tile3 = {x=222, y=331, z=5, stackpos=1} --change tilepos
    tile4 = {x=222, y=331, z=5, stackpos=1} --change tilepos
    gettile1 = getThingfromPos(tile1)
    gettile2 = getThingfromPos(tile2)
    gettile3 = getThingfromPos(tile3)
    gettile4 = getThingfromPos(tile4)

    if item.uid == 7007 and item.itemid == 1945 then
        doRemoveItem(gettile1.uid,1)
        doRemoveItem(gettile2.uid,1)
        doRemoveItem(gettile3.uid,1)
        doRemoveItem(gettile4.uid,1)
        doCreateItem(965,1,tile1) --change itemID
        doCreateItem(965,1,tile2) --change itemID
        doCreateItem(965,1,tile3) --change itemID
        doCreateItem(965,1,tile4) --change itemID
        doTransformItem(item.uid,item.itemid+1)
    elseif item.uid == 7007 and item.itemid == 1946 then
        doCreateItem(100,1,tile1)
        doCreateItem(100,1,tile2)
        doCreateItem(100,1,tile3)
        doCreateItem(100,1,tile4)
        doRemoveItem(gettile1.uid,1)
        doRemoveItem(gettile2.uid,1)
        doRemoveItem(gettile3.uid,1)
        doRemoveItem(gettile4.uid,1)
        doTransformItem(item.uid,item.itemid-1)        
    else
        doPlayerSendCancel(cid,"Sorry, not possible.")
    end

    return 1
end
Tested in Evolutions (made it a while ago;)) 7.92


EDIT: Shorter version of script, optimized by Talaturen.

Code:
-- Script made by Empty 
-- Optimized by Talaturen 
-- Visit http://otland.net 
-- 00:42 CET >> 2007-08-13 
local tile = {x = 222, y = 334, z = 5, stackpos = 1} 
local newId = 0 
function onUse(cid, item, frompos, item2, topos) 
   if item.itemid == 1945 then 
      newId = 965 
      doTransformItem(item.uid, item.itemid + 1) 
   else 
      newId = 100 
      doTransformItem(item.uid, item.itemid - 1) 
   end 
   for i = 1, 3 do 
      tile.y = tile.y - 1 
      doCreateItem(newId, 1, tile) 
      doRemoveItem(getThingfromPos(tile).uid, 1) 
   end 
   return TRUE 
end
Yours, Empty
 
Last edited:
WooooooooW I loved this.
Certainly I will use in my server.
Thank you very much for sharing.
Hugs hugs hugs :p
 
nice been looking for a script like this nice been looking for a script like this
 
To me, I can't see how this'll work since you're using unique IDs.. Specially since you're trying to use ONE SINGLE unique ID on THREE DIFFERENT coordinated tiles.
I still like the idea. =)
 
I got like 99% the same script but mine is from 7.6 and released on otcrap...
But mine removed walls. thats the only difference
 
Hehe :) well, there aren't very many ways to make this kind of scripts...
 
Looks great it's not messy at all like my script :p


And what if a player is standing on the bridge and gets it removed from under them?

as you can see it will send a massega "this is not possible" but if i looked at the script fastly i see what u mean all tiles of the brige will remove only the tile where the player stands not.. so what u could do is an player on the tiles and if a player stand on it it will sai "The brige is to heavey to lift it seems a player is standing on it"
 
Looks great it's not messy at all like my script :p




as you can see it will send a massega "this is not possible" but if i looked at the script fastly i see what u mean all tiles of the brige will remove only the tile where the player stands not.. so what u could do is an player on the tiles and if a player stand on it it will sai "The brige is to heavey to lift it seems a player is standing on it"

Yes or teleport the player to the other side.
 
Back
Top