Hello, it's the same request as here
But after 3 pages nobody wrote good script and topic was just mess so i've decided to write request again clearer.
This is what i need to works:
That should be :
When i put this lever and item's are on correct positions then these items disappear and in some xyz appears bridge (id 1284).
Old script : (don't working even if i deleted required item's, 'stackpos' and paste there id of coal basins..) there was always message in game "put on correct positions.."
Why i wrote new topic? Because someone in old one wrote bad script and others was just keep remaking it and nothing works.
Code:
http://otland.net/f132/actions-switch-items-correct-places-like-desert-q-114045/
But after 3 pages nobody wrote good script and topic was just mess so i've decided to write request again clearer.
This is what i need to works:
When i put this lever and item's are on correct positions then these items disappear and in some xyz appears bridge (id 1284).
Old script : (don't working even if i deleted required item's, 'stackpos' and paste there id of coal basins..) there was always message in game "put on correct positions.."
Lua:
local Items = {
{pos = {x=1030,y=1325,z=13,stackpos=2}, id = 9447},
{pos = {x=1033,y=1323,z=13,stackpos=2}, id = 2557},
{pos = {x=1036,y=1325,z=13,stackpos=2}, id = 6531},
{pos = {x=1033,y=1329,z=13,stackpos=2}, id = 5797}
}
local bridge = {
{pos = {x=1034,y=1263,z=11}}
}
function onUse(cid)
local items, item = {};
for _,itemData in pairs(Items) do
item = getTileItemById(itemData.pos, itemData.id);
if(item.uid == 2001)then
table.insert(items, item);
end
item = NULL; -- not sure;
end
if #items == #Items then
doCreateItem(1284,bridge)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to put item's on correct positions!")
end
return true
end
Why i wrote new topic? Because someone in old one wrote bad script and others was just keep remaking it and nothing works.