Song not playing for everybody

Hello so I have this script for a boombox, and the script is suppose to make when you put in the music id it will play that song, but it seems to only play for the player and not for everybody, here is the server and client script
SERVER SCRIPT

game.Players.PlayerAdded:Connect(function(LocalPlayer)
    LocalPlayer.PlayerGui:WaitForChild("BoomBoxGui").Frame.TextButton.MouseButton1Click:Connect(function()
        local Humanoid = LocalPlayer.Character:WaitForChild("Humanoid")
        local Character = LocalPlayer.Character
        local Sound = Character:FindFirstChild("BoomBox").Sound
        Sound:Play()
        game.ReplicatedStorage.BoomBox:FireAllClients()
    end)
end)

LOCAL SCRIPT

game.ReplicatedStorage.BoomBox.OnClientEvent:Connect(function()
    local Character = game.Players.LocalPlayer.Character
    local Text = script.Parent.Parent.TextBox.Text
    Character:FindFirstChild("BoomBox").Sound.SoundId = "rbxassetid://"..Text
    local Name = game:GetService("MarketplaceService"):GetProductInfo(Text).Name 
    script.Parent.Parent.NameId.Text = Name
end)

The server does not support GUI input events
Youll have to detect input on the client and validate it on the server using some form of event system

Mousebutton1clicks work in the server unlike other gui elements.

This is not true - and even if it were it still does not make sense to watch a UI event from a server script.

I tested it, it works. Don’t deny my test

Huh
Well the more you know

Apart from that, the other strange thing I see is that you’re not calling :Play() on the sound, is it always playing or did you forget to :Play() it?

local Humanoid = LocalPlayer.Character:WaitForChild("Humanoid")
        local Character = LocalPlayer.Character
        local Sound = Character:FindFirstChild("BoomBox").Sound
        Sound:Play()

Aswell as if it didn’t work it wouldn’t play the song when clicked it just doesn’t play it for everybody, so I have no idea where you got that.

You would probably have to send the “playing” player through the remote event. As of right now youre using the local player of each receiving end, which is the likely source of your problem

How do I fix them, i’m dumb at fixing it

I would do something along the lines of:

--server


--unrelated stuff
event:FireAllClients(LocalPlayer)

------------------------------------
--client

game.ReplicatedStorage.BoomBox.OnClientEvent:Connect(function(playerWithRadio)
    local Character = playerWithRadio.Character
    --etc...

end)

-------------------------------------

Perhaps try a fire server–and then

OnServerEvent:Connect(function()
for _, player in pairs (game.Players:GetPlayers()) do

local Character = player.Character
    local Text = --script.Parent.Parent.TextBox.Text whatever the location that the server can get to idk
    Character:FindFirstChild("BoomBox").Sound.SoundId = "rbxassetid://"..Text 
    local Name = game:GetService("MarketplaceService"):GetProductInfo(Text).Name 
    script.Parent.Parent.NameId.Text = Name
end
end)

Actually this doesn’t make sense considering its already being done via server.

Perhaps remove the fire clients and insert the get players for loop.

Fair enough- but my point still stands. This is not a good way to handle this code afaik, I imagine Client->Server & Sanity Checks -> All Clients makes much more sense. Otherwise, the problem with your code could be that it lacks necessary checks (is the boombox equipped? if not it will not exist inside of character).

Because this test works totally fine; the problem lies outside of your code structure. It could also be the inconsistent pathways which may or may not act how you expect them to.

Server:

game.Players.PlayerAdded:Connect(function(LocalPlayer)
	LocalPlayer.PlayerGui:WaitForChild("ScreenGui"):WaitForChild("ImageButton").MouseButton1Click:Connect(function()
		local Humanoid = LocalPlayer.Character:WaitForChild("Humanoid")
		local Character = LocalPlayer.Character
		game.ReplicatedStorage.BoomBox:FireAllClients()
	end)
end)

Client:

game.ReplicatedStorage.BoomBox.OnClientEvent:Connect(function()
	local Character = game.Players.LocalPlayer.Character
	print('i got it!')
end)

Did you figure it out? No one was marked as solution.

Yes, somebody ended up helping me on discord, thank you to everybody that tried to help.