This script inside a block activates a sound, moves a "lazer" and kills player, but, the sound is playing for everyone in the server, how can I just make the sound play for the LocalPlayer?
local part = script.Parent
local function onPartTouched(otherPart)
local partParent = otherPart.Parent
local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
game.Workspace.imaf.Playing = true
wait(3.3)
game.Workspace.LAZER:MoveTo(Vector3.new(-28.645, 7.881, -32.997))
humanoid.Health = 0
wait(1)
game.Workspace.LAZER:MoveTo(Vector3.new(-159.244, -5, -30.002))
game.Workspace.imaf.Playing = false
game.Workspace.imaf.TimePosition = 0
end
end
part.Touched:Connect(onPartTouched)
Btw, the sound is in Workspace, so that might be the problem, dont know where to put it.

1 comment
Also Didn't work, sorry