potinho
Intermediate OT User
Good evening, how to make it possible to use a certain item only if you have "X" storage? I have an action that gives the player a storage, but I only want it to be able to use it if it already has another storage (313722) = 1.
Lua:
local storage = 396122
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, storage) == -1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got a new look, open your clothes to check it out!!")
setPlayerStorageValue(cid, storage, 1)
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have this appearance.")
end
return true
end