potinho
Advanced OT User
Hi guys,
I have this action
I want to restrict the use of the item to the player who has storage 176602 with value greater than 75. So:
If storage 176602 > 75 (use ok)
If storage 176602 < 75 (message: u need at least 75 task points)
I have this action
Lua:
local config = {
effectonuse = 28, -- effect (/z)
levelsdodge = 100, --- Maximum dodge you can use
storagedodge = 48902 -- storage verification
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid, config.storagedodge) < config.levelsdodge then
doRemoveItem(item.uid, 1)
doSendMagicEffect(topos,config.effectonuse)
doPlayerSendTextMessage(cid,22,"You've advanced your dodge skill to ["..(getPlayerStorageValue(cid, config.storagedodge)+1).."/100].")
setPlayerStorageValue(cid, config.storagedodge, getPlayerStorageValue(cid, config.storagedodge)+1)
elseif getPlayerStorageValue(cid, config.storagedodge) >= config.levelsdodge then
doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of dodge skill.\nCongratulations!!!!")
return 0
end
return 1
end
I want to restrict the use of the item to the player who has storage 176602 with value greater than 75. So:
If storage 176602 > 75 (use ok)
If storage 176602 < 75 (message: u need at least 75 task points)