Making a star wars game, and I have a sound script here that plays when you get hit by a bullet.
function onTouched(hit) if hit.Name == "Bullet" then local S = Instance.new("Sound") S.Parent = workspace S.SoundId = "http://www.roblox.com/asset/?id=333632339" S.Volume = 1 S.Looped = true S.Playing = true end end script.Parent.Touched:connect(onTouched)
But it plays for everyone. How could I modify this so that it plays for the player only?
Put the sound inside of the player's Camera, just use a LocalScript.
Instead of putting the sound in the "workspace" simply put it into the torso of the player that was hit, or any other part that is close to it.