sharpy
New Member
- Joined
- Jan 4, 2010
- Messages
- 77
- Reaction score
- 0
Im teaching myself how to script and so far ive made a few small scripts and got them working but this one im stumped on script loads and i dont get any errors in the server console but the switch doesnt move and nothing happens here is the code ive wrote
can anyone tell me what Im doing wrong??
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 10103 then
if getPlayerStorageValue(cid, 30040) == -1 then
if (item.itemid == 1946) and getPlayerLevel(cid) >=8 then
doPlayerAddItem(cid, 2160, 1)
doPlayerSetStorageValue(30040, 1)
doPlayerSendCancel(cid, "You recieved a crystal coin.")
doTransformItem(item.uid, 1945)
elseif(item.itemid == 1945) and getPlayerLevel(cid) >=8 then
doPlayerAddItem(cid, 2160, 1)
doPlayerSetStorageValue(30040, 1)
doPlayerSendCancel(cid, "You recieved a crystal coin.")
doTransformItem(item.uid, 1946)
elseif(item.itemid == 1946) and getPlayerLevel(cid) < 8 then
doPlayerSendCancel(cid, "You do not have enough level.")
elseif(item.itemid == 1945) and getPlayerLevel(cid) < 8 then
doPlayerSendCancel(cid, "You do not have enough level.")
end
elseif getPlayerStorageValue(cid, 30040) > 0 then
doPlayerSendCancel(cid, "You have already pulled this lever.")
end
end
return 1
end
can anyone tell me what Im doing wrong??