if key.KeyCode == Enum.KeyCode.B then
print ("Playing "..charactervalue.." sound")
waiting = true
if character:FindFirstChild("Head"):FindFirstChild("Boo Sound") == nil then
local GhostNoobSound = Instance.new("Sound",character.Head)
GhostNoobSound.SoundId = "rbxassetid://533427376"
GhostNoobSound.Name = "Boo Sound"
GhostNoobSound.Volume = 0.8
GhostNoobSound.MaxDistance = 100
GhostNoobSound:Play()
else
character.Head["Boo Sound"]:Play()
end
wait(1)
waiting = false
end
It plays the sound for me, but other people can't hear it. I tried making an event on a server script, but I don't know how to get the player that pressed B. This script is a local script. Also, this isn't the full script, it's just the sound making part, so charactervalue and other stuff do exist.

4 comments
Use RemoteEvents and use FireServer() to send it to the Server. The OnServerEvent event will automatically have the client/player that sent the call as a parameter and any other parameters you provided with FireServer(). Once you play the sound on the server, it should play for all players.
But how do I make the sound play from the server script? How do I access the correct player's head's sound?
I put the server script into startecharacter, then found the player by saying script.Parent. But it still only lets me hear the sound. Why?
Ok, I have given up. I made it work, but it only worked for the first time. So when I pressed B, other people could hear it, but when I pressed it again, only I could hear it, even if I respawned. This makes absolutely no sense what-so-ever.