wait(0.5)
local sound = game.ReplicatedStorage.Boombox.Radio.Sound
sound.Volume = 1
local Pitch = script.Parent.Frame:findFirstChild("Pitch")
local VOL = script.Parent.Frame:WaitForChild("LOP")
local player = game.Players.LocalPlayer
repeat wait() until player.Character
sound.Parent = player.Character.Boombox
local Format = "http://www.roblox.com/asset/?id=##ID##"
local frame = script.Parent:WaitForChild("Frame")
frame:WaitForChild("Play").MouseButton1Click:connect(function()
sound.Pitch = Pitch.Text
local input = tonumber(frame:WaitForChild("Input").Text)
if input then
sound:Stop()
sound.SoundId = Format:gsub("##ID##", tostring(input))
sound:Play()
end
end)
frame:WaitForChild("Stop").MouseButton1Click:connect(function()
sound:Stop()
end)
frame:WaitForChild("LOP").MouseButton1Click:connect(function()
if sound.Looped == false then
sound.Looped = true
script.Parent.Frame.LOP.Text = " X "
else
sound.Looped = false
script.Parent.Frame.LOP.Text = ""
end
end)
-- why Sound could not be heard by other players but only you can hear it?
Why Sound could not be heard by other player? [RADIO SCRIPT ISSUE]
2 answers
It's because you're running it on a localscript which plays the sound only to the client.
I think you are doing this in a local script because I see that you used Local Player in your code. If you are doing this in a localscript, then your code will only run on the client, which means the client will see your code's output (the sound). It also means that no other people will hear it, because whatever code is on a local script will not replicate to the server. I am about to tell how to fix this. Here is what you need to do: Use remote events and remote functions. I, unfortunately, do not know much about these objects, but I know a youtube channel that has a few videos about remote events and remote functions. There are also people on this website who know a lot about them. Click here to see tutorials about how to use remotes:
https://www.youtube.com/watch?v=-KqiPiE5P74
If answer does not help you, I am very sorry. If it does, you are welcome.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
do i need to change anything in this script?