Jump to content

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

 

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)

 

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
×
  • Create New...