Cant switch music ID

Hi!

I have a seemingly simple jukebox script that doesn’t work, with the error “Could not download sound data.”

This is my code.

script.Parent.MouseButton1Click:Connect(function()
	local plots = workspace:WaitForChild("Plots")
	local function getPlot()
		return plots:FindFirstChild(game.Players.LocalPlayer.Name .. "'s Plot"):FindFirstChild("BuildPlot")
	end

	local function Sound()
		local plot = getPlot()
		if plot then
			return plot:FindFirstChild("Jukebox"):FindFirstChild("Main"):FindFirstChild("Sound")
		else
			return nil
		end
	end

	local JB = Sound()
		Sound().SoundId = "rbxassetid//"..script.Parent.Parent.br.Text
end)

Ignore the overcomplex finding code, it’s a long story.

Thanks for any help!

Maybe put it in a pcall until it works

you’re missing the : here.

Sound().SoundId = "rbxassetid://"..script.Parent.Parent.br.Text

Kinda uprelated, but do you know why I can only trigger this proximityprompt once?

script.Parent.ProximityPrompt.Triggered:Connect(function(Player)
	if script.Parent.Parent.Parent.Parent.Name == Player.Name.."'s Plot" then
		Player.PlayerGui.MusicPick.Main.Visible = true
	else
		Player.PlayerGui.MusicPick.Un.Visible = true
	end
end)

Late reply, but, I’m assuming this problem is due to the server changing this and trying to change this value to the same thing it was last time, while the client changes the value, meaning this doesn’t change on the client but the server says differently.