Jump to content

Custom onBurnt / Listening to onburnt / extra functions


Recommended Posts

local function onburnt(inst)
    inst.SoundEmitter:PlaySound("phonograph/end")
    inst.SoundEmitter:KillSound("phonograph/play")
    DefaultBurntStructureFn(inst)

    inst:AddTag("burnt")
    inst:PushEvent("turnedoff")
end

How do I make it so I get the normal effects of a burnt structure (coal drops etc.) but I can do extra stuff when onburnt happens?

I tried with this as well, but did not get it working either way
 

local function OnBurntPhonograph(inst)
    inst:PushEvent("turnedoff")
    inst.SoundEmitter:PlaySound("phonograph/end")
    inst.SoundEmitter:KillSound("phonograph/play")
end
inst.ListenForEvent("onburnt", OnBurntPhonograph)


I'm happy about any help - thanks in advance!!

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...