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?
I tested my script out and I found out that it works!
local okbutton = script.Parent.TextButton okbutton.MouseButton1Click:Connect(function() local id = script.Parent.TextBox.Text local music1 = Instance.new("Sound") music1.Parent = game.Workspace music1.SoundId = "rbxassetid://"..id wait(1) music1:Play() end)