Hello, so I've made a really simple taunt system for a gamemode I'm doing. However when the player does a taunt it doesn't follow the player around, the sound doesn't. How would I do it so that the sound follows the player?
function Taunt_System( ply )
local taunt = "taunt_system/"..table.Random(taunts)..".mp3"
local taunt_cooldown = SoundDuration(taunt) + 15
if ply.UnStuckCooldown == nil then
ply.UnStuckCooldown = CurTime() - 1
end
if(ply.UnStuckCooldown < CurTime() && ply:Alive() && ply:Team() == 1 ) then
sound.Play( taunt, ply:GetPos() )
ply:PS_GivePoints(5)
ply:ChatPrint( "You were given 5 points for taunting!" )
ply.UnStuckCooldown = CurTime() + taunt_cooldown
return SoundDuration(taunt)
end
end
hook.Add("ShowSpare1", "Taunt_System", Taunt_System)
Would I need to use EmitSound instead?
Yes, Entity:EmitSound is the way to go here.
replace sound.Play( taunt, ply:GetPos() ) to ply:EmitSound(taunt)
Sorry, you need to Log In to post a reply to this thread.