I want to play a sound for the player that collides with the goal. It works, but it plays for every player in the game, not just the colliding player.
Here is my script:
script.Parent.Touched:Connect(function(hit) --Use :Connect(), :connect() is deprecated.
if hit.Parent:FindFirstChild('Humanoid') and game.Players:GetPlayerFromCharacter(hit.Parent) then
hit.Parent.Head.CFrame = CFrame.new(-118.926, 359.897, 18.574)
hit.Parent.Humanoid.WalkSpeed = 16
game.StarterGui.LevelComplete:Play()
wait(3)
end
end)
Also, I should probably note that the sound plays while in Studio, but not in Server testing.
Thanks, Mexhe

1 comment
remote events local scripts yadda yadda go look up filtering enabled