So I made a GUI and put this script in it.
local okbutton = script.Parent.TextButton
function onClicked(id)
id = script.Parent.TextBox.Text
local music1 = Instance.new("Sound")
music1.Parent = game.Workspace
music1.SoundId = "http://www.roblox.com/asset/?id="..id
wait(1)
music1:Play()
end
script.Parent.TextButton.MouseButton1Click:Connect(onClicked)
Well, it's not working. Can somebody help me fix this?

3 comments
You just had to change your music1.SoundId to "rbxassetid://" instead of "http://www.roblox.com/asset/?id="
Hi there!
Yes it's working, but i want to make it like the music plays in the whole server using RemoteEvent. I accidentally posted this question 2 times can you check the script what i wrote here? I would be very grateful. https://scriptinghelpers.org/questions/124882/a-script-that-play-a-music-in-a-game