Darqneez
ShaC-Ohhhh
Hello, I need a script for levers.
Description
1 to 3 black numbers, are numbers of levers
1 to 3 red numbers, are numbers of stones that should appear
1 to 3 green number, are numbers of stones that should disappear
I have written a script some hours ago but it doesnt work
I want script to do 1 thing. I know I need 3 such a scripts, but when I have the first one, I will know how to build two others. What should the script do? When using lever number 1 it should make stones with red number 1 appear and stone with green number 1 disappear. if Lever is used it should do it vice versa. Here's my not working script, maybe some rework would help. Please help me fast
Here's image in better quality uploaded with imageshack.com:
Imageshack - helppls2.png
Description
1 to 3 black numbers, are numbers of levers
1 to 3 red numbers, are numbers of stones that should appear
1 to 3 green number, are numbers of stones that should disappear
I have written a script some hours ago but it doesnt work
I want script to do 1 thing. I know I need 3 such a scripts, but when I have the first one, I will know how to build two others. What should the script do? When using lever number 1 it should make stones with red number 1 appear and stone with green number 1 disappear. if Lever is used it should do it vice versa. Here's my not working script, maybe some rework would help. Please help me fast
Code:
local gatepos1 = {x=2130, y=1881, z=14, stackpos=1}
local gatepos2 = {x=2121, y=1873, z=14, stackpos=1}
local gatepos3 = {x=2113, y=1881, z=14, stackpos=1}
local gatepos4 = {x=2121, y=1888, z=14, stackpos=1}
function onUse(cid, item, frompos, item2, topos)
local getgate1 = getThingfromPos(gatepos1)
local getgate2 = getThingfromPos(gatepos2)
local getgate3 = getThingfromPos(gatepos3)
local getgate4 = getThingfromPos(gatepos3)
if item.itemid == 1945 and getgate1.itemid == 0 then
doCreateItem(getgate1.uid, 1)
doTransformItem(item.uid, item.itemid+1)
elseif item.itemid == 1946 and getgate1.itemid == 1304 then
doRemoveItem(1304, 1, gatepos1)
doTransformItem(item.uid, item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
if item.itemid == 1945 and getgate2.itemid == 0 then
doCreateItem(getgate2.uid, 1)
doTransformItem(item.uid, item.itemid+1)
elseif item.itemid == 1946 and getgate2.itemid == 1304 then
doRemoveItem(1304, 1, gatepos2)
doTransformItem(item.uid, item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
if item.itemid == 1945 and getgate3.itemid == 0 then
doCreateItem(getgate3.uid, 1)
doTransformItem(item.uid, item.itemid+1)
elseif item.itemid == 1946 and getgate3.itemid == 1304 then
doRemoveItem(1304, 1, gatepos3)
doTransformItem(item.uid, item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
if item.itemid == 1945 and getgate4.itemid == 1304 then
doRemoveItem(getgate4.uid, 1)
doTransformItem(item.uid, item.itemid+1)
elseif item.itemid == 1946 and getgate4.itemid == 0 then
doCreateItem(1304, 1, gatepos4)
doTransformItem(item.uid, item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end
Here's image in better quality uploaded with imageshack.com:
Imageshack - helppls2.png
Attachments
-
helppls.jpg33.2 KB · Views: 12 · VirusTotal
Last edited: