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

Rookgaard drawbridge issue

lunara

Member
Joined
Dec 20, 2014
Messages
140
Reaction score
8
When i press the lever it wont happing anything...
here is a pic when i click
EzgubWf.png

I use tfs 0.4 SVN

Here my rats.lua
Code:
function onUse(cid, item, frompos, item2, topos)
gatepos = {{x=1099, y=1205, z=8}, {x=1100, y=1205, z=8}, {x=1101, y=1205, z=8}}
getgate = getThingfromPos(gatepos)

if item.uid == 4508 and item.itemid == 1945 and getgate.itemid == 5770 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 4508 and item.itemid == 1946 and getgate.itemid == 0 then
doCreateItem(5770,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end
  return 1
  end
REPP++ Help!
 
Code:
local positions = {
[1] = {x = 1099, y = 1205, z = 8}, --dont touch--
[2] = {x = 1100, y = 1205, z = 8}, --dont touch--
[3] = {x = 1101, y = 1205, z = 8} --dont touch--
}

local left_side = {x = 1098, y = 1205, z = 8} --dont touch--
local right_side = {x = 1102, y = 1205, z = 8} --dont touch--

local lever = 1945 --dont touch--
local lever2 = 1946 --dont touch--
local lever_pos = {x = 1098, y = 1204, z = 8} --dont touch--
local lever2_pos =  {x = 1104, y = 1201, z = 8} --dont touch--
local uid = 4508 --dont touch--
local bridge_tile = 5770 --dont touch--

-------------EDIT HERE-------------------------
local water_id = 1111 --Set to any water id
local left_bank = 1111 -- set to item id of the left side water border (where water connects to land)
local right_bank = 1111 --Set to itemid of the right side water border (where water connects to land)
------------------------------------------------
function onUse(cid, item, frompos, item2, topos)
  
    if item.itemid == lever and item.uid == uid then
    ------------Create Bridge-------------------
        for i = 1, #positions do
            doCreateItem(bridge_tile, 1, positions[i])
        end
        doTransformItem(getThingFromPos(lever_pos).uid, lever2)
        doTransformItem(getThingFromPos(lever2_pos).uid, lever2)
        doItemSetAttribute(getThingFromPos(lever_pos).uid, 'uid', uid)
        doItemSetAttribute(getThingFromPos(lever2_pos).uid, 'uid', uid)
    -------------------------------------------------
    elseif item.itemid == lever2 and item.uid == uid then
    ----------TELEPORT ANY PLAYERS STANDING ON BRIDGE--------------------
        for i = 1, #positions do
            if isPlayer(getThingFromPos(positions[i]).uid) then
                if positions[i] == positions[1] then
                    doTeleportThing(getThingFromPos(positions[i]).uid, left_side)
                elseif positions[i] == positions[2] then
                    doTeleportThing(getThingFromPos(positions[i]).uid, left_side)
                elseif positions[i] == positions[3] then
                    doTeleportThing(getThingFromPos(positions[i]).uid, right_side)
                end
            end
        end
    -----------------------------------------------------------------------
    ----------------------REMOVE BRIDGE-----------------------------------
        for i = 1, #positions do
            if positions[i] == positions[1] then
                doTransformItem(getThingFromPos(positions[i]).uid, left_bank)
            elseif positions[i] == positions[2] then
                doTransformItem(getThingFromPos(positions[i]).uid, water_id)
            elseif positions[i] == positions[3] then
                doTransformItem(getThingFromPos(positions[i]).uid, right_bank)
            end
        end
        doTransformItem(getThingFromPos(lever_pos).uid, lever1)
        doTransformItem(getThingFromPos(lever2_pos).uid, lever1)
        doItemSetAttribute(getThingFromPos(lever_pos).uid, 'uid', uid)
        doItemSetAttribute(getThingFromPos(lever2_pos).uid, 'uid', uid)
    end-----------------------------------------------------------------
return true
end
I need to sleep and will try tomorrow good night!
 
I want to to remove that ground in middle..
But I am can't see that on mapeditor help!!
Just remove the bridge in the map editor and you will see the tiles below then place the bridge back on top, please don't freak out with "help!!" every-time you have a problem.
 
Code:
local posi3 = {x=1200, y=1230, z=8}
poss = {
[1] = {x=1197, y=1230, z=8},
[2] = {x=1198, y=1230, z=8},
[3] = {x=1199, y=1230, z=8}
}

local lever = {
[1] = {x=1196, y=1229, z=8},
[2] = {x=1202, y=1229, z=8}
}
local itemids = 5770
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
doCreateItem(itemids,poss[2])
if getTileItemById(poss[1],13741).itemid ~= nil then
doTransformItem(getTileItemById(poss[1],13741).uid,itemids)
end
if getTileItemById(poss[3],13743).itemid > 0 then
doTransformItem(getTileItemById(poss[3],13743).uid,itemids)
end
for i=1,#lever do
if lever.x == fromPosition.x then
o = i
end
end
if o == 1 then
b = 2
else
b = 1
end

doTransformItem(getTileItemById(lever[1],1945).uid,1946)
doTransformItem(getTileItemById(lever[2],1945).uid,1946)
elseif item.itemid == 1946 then
for p = 1,#poss do
doRelocate(poss[p], posi3)
end
for z =1,#poss do
poss[z].stackpos = 254
if getThingFromPos(poss[z]).itemid > 1000 then
doRemoveItem(getThingFromPos(poss[z]).uid)
end
poss[z].stackpos = 1
if getThingFromPos(poss[z]).itemid > 1000 then
doRemoveItem(getThingFromPos(poss[z]).uid)
end

end
for i=1,#lever do
if lever.x == toPosition.x then
o = i
end
end
if o == 1 then
b = 2
else
b = 1
end
doCreateItem(13547,poss[2])
doCreateItem(9021,poss[1])
doCreateItem(9021,poss[3])
doCreateItem(13741,poss[1])
doCreateItem(13743,poss[3])

doTransformItem(getTileItemById(lever[1],1946).uid,1945)
doTransformItem(getTileItemById(lever[2],1946).uid,1945)
end
return TRUE
end

<action actionid="44002" event="script" value="sewerBridge.lua" />
What is this mess?o_O
 
Back
Top