transforma esse script para tfs 0.3.6 +rep
+rep
function onUse(cid, item, fromPosition, itemEx, toPosition)
local food = foods[item.itemid]
if not food then
return false
end
local player = Player(cid)
local condition = player:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
if condition and math.floor(condition:getTicks() / 1000 + food[1]) >= 1200 then
player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You are full.')
return true
end
player:feed(food[1] * 12)
player:say(food[2], TALKTYPE_MONSTER_SAY)
Item(item.uid):remove(1)
return true
end