Jump to content

Play Wolf's powerup animation when eat something


Recommended Posts

Hello everyone, i'm doing mod when you eat something, that plays wolfgang "powerup" animation, i've tried this code, the game don't crash, but when i eat meat for example nothing happens.

My current code:

 

local function oneat(inst)
   inst.sg:PushEvent("powerup")
   inst.SoundEmitter:PlaySound("dontstarve/characters/wolfgang/grow_smtomed")
end

 

Link to comment
Share on other sites

3 hours ago, Kynoox_ said:

Hello everyone, i'm doing mod when you eat something, that plays wolfgang "powerup" animation, i've tried this code, the game don't crash, but when i eat meat for example nothing happens.

My current code:

 


local function oneat(inst)
   inst.sg:PushEvent("powerup")
   inst.SoundEmitter:PlaySound("dontstarve/characters/wolfgang/grow_smtomed")
end

 

Did you call your function?

--master postinit
inst.components.eater:SetOnEatFn(oneat)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...