Hi! I'm having trouble with this. The script works, and when I click 1, the sound works and I can hear it in my game. However, no one else can hear it.
player = game.Players.LocalPlayer char = player.Character humn = char.Humanoid mouse = game.Players.LocalPlayer:GetMouse() function KeyD(key) key = key:lower() if key =="1" then sound = Instance.new("Sound") sound.Volume = 1 sound.SoundId = "rbxassetid://690573922" sound.Parent = char.Head sound:Play() wait(3) sound:Destroy() end end mouse.KeyDown:connect(KeyD)
This is in a LocalScript, and changing it to a regular Script makes the sound not work at all. Any advice?
You must use a local script to call the key function, and instead of creating the sound from there, it sends an event to the server.
Then you must have a server script, that reacts to that fired event, and creates the sound on the given character.