I made a little code... But It doesn't work
workspace.Level1.Platform.Touched:Connect(function(Hit) local Player = script.Parent.Parent.Parent.Parent.Name if Hit.name == Player.Name then script.Parent.Playing = true end end)
Please tell me what to do!....
This is quite simple in fact.
If this is a server script:
Fire a remote to the player you want to hear the sound (See FireClient, RemoteEvents). This could also work with RemoteFunctions (See InvokeClient, RemoteFunctions).
Obtain the sound, place it wherever you want in the localscript and then proceed to play it. This will make only that one player hear it.
If this is already a local script, playing it will be sufficient.
Well, I found a solution on YouTube! This is by AlvinBlox
SelectTheObject.Touched:Connect(function(Hit) if Hit.Parent:FindFirstChild('Humanoid') then game.Players[Hit.Parent.Name].PlayerGui.Sound:Play() game.Players[Hit.Parent.Name].PlayerGui.Sounds:Stop() end end)
But Thank you!