local storage = 37483 -- storageID to be used anywhere throughout the script.
function onUse(cid, item, fromPosition, itemEx, toPosition) -- If the item is used.
if getPlayerStorageValue(cid, storage) == -1 then -- If the storage value above is not in use (-1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got a storagevalue.") -- Send the player a message
setPlayerStorageValue(cid, storage, 1) -- set the storage value to 1 (in use)
doRemoveItem(item.uid, 1) -- remove the item that that was used.
else -- if above is not true (if storage is not equal to -1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already clicked on this.") -- Send player message saying they already have done this before
end -- end the if statement
return true -- I'm actually unsure why we use this, my guess is that it is checking to see if the script is actually finished at this point and that the function has completed successfully
end -- end the function onUse