Try this: champion:consumeFood (350)Eleven Warrior wrote: ↑Wed Mar 18, 2020 10:12 am I trying to get this potion to work when the champ drinks it the food bar should go up but, this potion here is not working Help...
defineObject{
name = "potion_restore",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/flask.fbx",
},
{
class = "Item",
uiName = "Potion of Restoration",
gfxIndex = 148,
weight = 0.3,
stackable = true,
description = "Drinking the potion will cause the champion to be bestowed with a torrent of powerful energy and healing that cleanses ailments and provides nourishment.",
traits = { "potion" },
},
{
class = "UsableItem",
sound = "consume_potion",
emptyItem = "flask",
onUseItem = function(self, champion)
playSound("consume_potion")
champion:regainFood(350) --- This wrong it crashes
return true
end,
},
},
tags = { "zim_assets" },
}
However, for energy and health you have to use regain.