• Changing player's footsteps
    0 replies, posted
Hello I want to change the player's footsteps when they equip the item in nutscript. I looked up how to change the footsteps on the wiki, but there is only a function. I am pretty sure I shouldn't be putting a function inside of a function. I think I am supposed to use a hook but I am not sure how to do that. Below is the horribly wrong code: [CODE] ITEM:hook("Equip", function(item) function GM:PlayerFootstep( ply, pos, foot, sound, volume, rf ) ply:EmitSound( "NPC_Hunter.Footstep" ) -- Play the footsteps hunter is using return true -- Don't allow default footsteps end end) [/CODE] [editline]5th July 2017[/editline] I think I'm getting closer [CODE] ITEM:hook("Equip", function(item) function ChangeStepSound(ply, vec, foot, sound, vol) ply:EmitSound( "npc/dog/dog_footstep_run1.wav" ) return true end hook.Add("PlayerFootstep", "ChangeStepSounds", ChangeStepSound) end) [/CODE] [editline]5th July 2017[/editline] How I posted is how you do it.. Derp
Sorry, you need to Log In to post a reply to this thread.