• 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 Whats wrong with this script

Sir Bananas

Lua Scripter, Spriter
Joined
Jul 19, 2011
Messages
344
Reaction score
29
Location
Brazil
PHP:
function onUse(cid, item, frompos, item2, topos)
pos1 = {x=1014, y=1023, z=9, stackpos=253}
pos2 = {x=1013, y=1023, z=9}
if item.itemid == 1945 then
if getGlobalStorageValue == 0 then
setGlobalStorageValue(40003, 1)
doTransformItem(item.uid, item.itemid + 1)
elseif getGlobalStorageValue == -1 then
setGlobalStorageValue(40003,0)
doTransformItem(item.uid, item.itemid + 1)
end
end
if item.itemid == 1946 then
if getGlobalStorageValue == 1 then
setGlobalStorageValue(40003, 0)
doTransformItem(item.uid, item.itemid - 1)
elseif getGlobalStorageValue == 0 then
setGlobalStorageValue(40003, -1)
doTransformItem(item.uid, item.itemid - 1)
end
end
return TRUE
end
Can anyone tell me whats wrong with this script? I dont get an error message or anything, but when i pull the levers nothing happens :/
 
What is supposed to happen? As far as I see, it looks like it just gives you the storage value.
 
Yea, it's just supposed to set the storage value, but i figured it out ^^
PHP:
elseif getGlobalStorageValue == 0 then
I didnt have the key for the storage value
 
Last edited:
You must define the things, put a name to the "getGlobalStorageValue" because nothing on him says which one is the number of the particular global storage value.

re-define it all of em, because you'll put two of them like condition of one if and one elseif without specify:
Code:
if getGlobalStorageValue == 0 then

to something like this:
Code:
getGlobalStorageValue(40186) = Statics1they1
if Statics1they1 == -1 then

it's just one idea, maybie work, but i can be commit a mistake, ¡tell me how it works! ;)

¡Wishing you the Best!
(Y)(Y)

-Obsdark-
 
Back
Top