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

Lua Need help with this lever script.

Grinch

www.loronia.se
Joined
Oct 19, 2007
Messages
217
Reaction score
0
Location
Sweden/Värnamo
Ok i got a problem with this script. It is supposed to buy bp with sd runes.
When i press on the lever the first time when the lever is item id: 1945 it works.
But second time when the lever is 1946 it only buys a empty backpack. I need the lever to stay on 1945 and not transform to 1946. Or that i could buy when it is 1946 too.

Here is the script:

PHP:
 function onUse(cid, item, frompos, item2, topos)

container = doPlayerAddItem(cid, 2003, 1)

if item.itemid == 1945 and doPlayerRemoveMoney(cid,3000) == 1 then
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doAddContainerItem(container, 2268, 25)
doTransformItem(item.uid,item.itemid+1)
else
doPlayerSendCancel(cid,"Bp sds = 3k")
end

return 1
end
 
NEVER MIND, I FIXED IT.

If someone got same problem you can change this line:
PHP:
doTransformItem(item.uid,item.itemid+1)

To this one:
PHP:
doTransformItem(item.uid,item.itemid+0)
 
Back
Top