Udun
Well-Known Member
- Joined
- Jan 5, 2012
- Messages
- 193
- Solutions
- 1
- Reaction score
- 68
Hello there, I got this script that remove a big stone by lever (this is a stone that uses 4sqm), in fact are 4 different items id's
Doesn't work, I was wondering if here is a experienced scripter that can give me a hand.
I use TFS 0.3.6
This is the script:
Thanks!
------------------------------
EDIT
Well, I found a new one, so the problem is solved, credits to: Chaootiick
Doesn't work, I was wondering if here is a experienced scripter that can give me a hand.
I use TFS 0.3.6
This is the script:
Lua:
function onUse(cid, item, frompos, item2, topos)
wall1 = {x=2625, y=1678, z=3, stackpos=1},
wall2 = {x=2626, y=1678, z=3, stackpos=1},
wall3 = {x=2625, y=1679, z=3, stackpos=1},
wall4 = {x=2626, y=1679, z=3, stackpos=1}
getwall1 = getThingfromPos(wall1),
getwall2 = getThingfromPos(wall2),
getwall3 = getThingfromPos(wall3),
getwall4 = getThingfromPos(wall4)
if item.uid == 60261 and item.itemid == 1945 then
doRemoveItem(getwall1.uid,1)
doRemoveItem(getwall1.uid,2)
doRemoveItem(getwall1.uid,3)
doRemoveItem(getwall1.uid,4)
doTransformItem(item.uid,item.itemid+1)
doTransformItem(item.uid,item.itemid+1)
doTransformItem(item.uid,item.itemid+1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 60261 and item.itemid == 1946 then
doCreateItem(1300,1,wall1)
doTransformItem(item.uid,item.itemid-1)
else
doCreateItem(1301,1,wall2)
doTransformItem(item.uid,item.itemid-1)
else
doCreateItem(1302,1,wall3)
doTransformItem(item.uid,item.itemid-1)
else
doCreateItem(1303,1,wall4)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end
Thanks!
------------------------------
EDIT
Well, I found a new one, so the problem is solved, credits to: Chaootiick
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
removals = {
{ item = 1300, pos = {x = 2625, y = 1678, z = 3 } },
{ item = 1301, pos = {x = 2626, y = 1678, z = 3 } },
{ item = 1302, pos = {x = 2625, y = 1679, z = 3 } },
{ item = 1303, pos = {x = 2626, y = 1679, z = 3 } }
}
if item.itemid == 1945 then
for i = 1, #removals do
removals[i].pos.stackpos = 1
doRemoveItem(getThingfromPos(removals[i].pos).uid, 1)
end
doTransformItem(item.uid, item.itemid + 1)
elseif item.itemid == 1946 then
for i = 1, #removals do
doCreateItem(removals[i].item, 1, removals[i].pos)
end
doTransformItem(item.uid, item.itemid - 1)
end
return TRUE
end
Last edited: