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

Lever bridge Rookgaard Bug help

krejken

Member
Joined
Nov 24, 2009
Messages
153
Reaction score
13
Location
poland
hi. just look...this f... bugUO0402.jpg UO0403.jpg

my script:
local config = {
bridgePositions = {
{position = Position(32099, 32205, 8), groundId = 351, itemId = 4645},
{position = Position(32100, 32205, 8), groundId = 4616},
{position = Position(32101, 32205, 8), groundId = 351, itemId = 4647}
},
leverPositions = {
Position(32098, 32204, 8),
Position(32104, 32204, 8)
},
relocatePosition = Position(32102, 32205, 8),
relocateMonsterPosition = Position(32103, 32205, 8),
bridgeId = 5770
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local leverLeft, lever = item.itemid == 1945
for i = 1, #config.leverPositions do
lever = Tile(config.leverPositions):getItemById(leverLeft and 1945 or 1946)
if lever then
lever:transform(leverLeft and 1946 or 1945)
end
end

local tile, tmpItem, bridge
if leverLeft then
for i = 1, #config.bridgePositions do
bridge = config.bridgePositions
tile = Tile(bridge.position)

tmpItem = tile:getGround()
if tmpItem then
tmpItem:transform(config.bridgeId)
end

if bridge.itemId then
tmpItem = tile:getItemById(bridge.itemId)
if tmpItem then
tmpItem:remove()
end
end
end
else
for i = 1, #config.bridgePositions do
bridge = config.bridgePositions
tile = Tile(bridge.position)

tile:relocateTo(config.relocatePosition, true, config.relocateMonsterPosition)
tile:getGround():transform(bridge.groundId)
Game.createItem(bridge.itemId, 1, bridge.position)
end

end
return true
end


script working perfect but only this bug.. ehh. Somebody help me??
 
Last edited by a moderator:
hi. just look...this f... bugView attachment 33418 View attachment 33419

my script:
local config = {
bridgePositions = {
{position = Position(32099, 32205, 8), groundId = 351, itemId = 4645},
{position = Position(32100, 32205, 8), groundId = 4616},
{position = Position(32101, 32205, 8), groundId = 351, itemId = 4647}
},
leverPositions = {
Position(32098, 32204, 8),
Position(32104, 32204, 8)
},
relocatePosition = Position(32102, 32205, 8),
relocateMonsterPosition = Position(32103, 32205, 8),
bridgeId = 5770
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local leverLeft, lever = item.itemid == 1945
for i = 1, #config.leverPositions do
lever = Tile(config.leverPositions):getItemById(leverLeft and 1945 or 1946)
if lever then
lever:transform(leverLeft and 1946 or 1945)
end
end

local tile, tmpItem, bridge
if leverLeft then
for i = 1, #config.bridgePositions do
bridge = config.bridgePositions
tile = Tile(bridge.position)

tmpItem = tile:getGround()
if tmpItem then
tmpItem:transform(config.bridgeId)
end

if bridge.itemId then
tmpItem = tile:getItemById(bridge.itemId)
if tmpItem then
tmpItem:remove()
end
end
end
else
for i = 1, #config.bridgePositions do
bridge = config.bridgePositions
tile = Tile(bridge.position)

tile:relocateTo(config.relocatePosition, true, config.relocateMonsterPosition)
tile:getGround():transform(bridge.groundId)
Game.createItem(bridge.itemId, 1, bridge.position)
end

end
return true
end


script working perfect but only this bug.. ehh. Somebody help me??
Mybe remove this in map editor?
 
Lua:
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])[ATTACH type="full"]42338[/ATTACH]
doCreateItem(13743,poss[3])

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

Just edit coords
this script is for with version tfs?? i have tfs 1.2
Post automatically merged:

or use mine :)
mine works

CARRE on yours scripy i have same problem. i thing is sompihing missing in my engine
 

Attachments

  • Przechwytywanie.PNG
    Przechwytywanie.PNG
    43.2 KB · Views: 14 · VirusTotal
  • Przechwytywanie.PNG
    Przechwytywanie.PNG
    96.1 KB · Views: 13 · VirusTotal
Last edited:
im having the same issue im ussing tfs 1.3 downgraded from nekiro
im using almost the same script this is my error
Lua:
Lua Script Error: [Action Interface]
data/actions/scripts/rook/sewer grate switch.lua:onUse
data/actions/scripts/rook/sewer grate switch.lua:77: attempt to index a nil value
stack traceback:
        [C]: in function '__index'
        data/actions/scripts/rook/sewer grate switch.lua:77: in function <data/actions/scripts/rook/sewer grate switch.lua:44>

line 77 of the lua script
Code:
tile:getGround():transform(bridge.groundId)
 
Back
Top