Jump to content

Need help figuring out something


Recommended Posts

Hello!
Can anyone help me figure out how to make character do three things when 2 days are past: drop item, make sound and do animation

I included the code I have in character.lua in master_postinit
Character do drop item when two days are past but no animation or sound plays

local playsound = nil 

if inst.components.periodicspawner ~= nil or inst.components.periodicspawner:SetRandomTimes(TUNING.TOTAL_DAY_TIME * 2, TUNING.SEG_TIME * 2) then
   playsound = true
   inst.components.periodicspawner:SetPrefab("manrabbit_tail")
   inst.components.periodicspawner:Start()
   inst.AnimState:PushAnimation("emote_flex")
   if playsound then
   inst.SoundEmitter:PlaySound("wolfgang2/common/gym/rhythm")
   end
end

 

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