não deu pra enteder bem o que era pra ser isso aí, mas tenta assim:
function hasWater(cid, percent, item, limit)
if percent > (limit or 100) then return false end
local pouch = item or getPlayerSlotItem(cid, 10)
local ids = {11941, 11943}
if isInArray(ids, pouch.itemid) and (pouch.actionid == 0 and 100 or pouch.actionid-100) >= percent then
local newtype = (pouch.actionid == 0 and 100 + (limit or 100) or pouch.actionid) - percent
if newtype == 100 then
doTransformItem(pouch.uid, 11940)
end
doSetItemActionId(pouch.uid, newtype)
return newtype
end
return false
end
function onLook(cid, thing, position, lookDistance)
if thing.itemid > 1 then
local n = hasWater(cid, 0, thing, 200)
if n then
doPlayerSendTextMessage(cid, 22, (n-100) .. "% of water.")
end
end
return true
end






info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78
Como posso fazer um onlook pra esses ids 11941,11943
esse é o script do % q cada item vai ter
function hasWater(cid, percent)
if percent > 100 then return false end
local pouch = getPlayerSlotItem(cid, 10)
if pouch.itemid == 11941 and (pouch.actionid == 0 and 100 or pouch.actionid-100) >= percent then
newtypee = (pouch.actionid == 0 and 200 or pouch.actionid) - percent
if newtypee == 100 then doTransformItem(pouch.uid, 11940) end
doSetItemActionId(pouch.uid, newtypee)
return true
end
end
function hasWaterSpecial(cid, percent)
if percent > 200 then return false end
local pouchs = getPlayerSlotItem(cid, 10)
if pouchs.itemid == 11943 and (pouchs.actionid == 0 and 100 or pouchs.actionid-100) >= percent then
newtypeee = (pouchs.actionid == 0 and 300 or pouchs.actionid) - percent
if newtypeee == 100 then doTransformItem(pouchs.uid, 11942) end
doSetItemActionId(pouchs.uid, newtypeee)
return true
end
end
edit: eu tentei fazer um só q ai o % n aparece pro item q n esta no slot
q ficou assim \/
alguem me ajuda ai plz =/
Editado Junho 8 por rohfagundes