Ok. Lets assume I have a text box, named IdNumber and a text button, named Enter. (The rest is explained in the script.) Why doesn't it work? - ERROR(18:35:13.054 - httpGet http://roblox.com/asset/?id=Enter In ID(Numbers Only) failed. Trying again. Error: HTTP 400 (Input string was not in a correct format.). Elapsed time: 0.124959) SCRIPT:
Enter = script.Parent.Enter preloadurl = "http://roblox.com/asset/?id=" local IDNumber = script.Parent.IdNumber.Text songnumber = 0 Enter.MouseButton1Down:connect(function(clicked) local Music = Instance.new("Sound") songnumber = songnumber + 1 Music.Parent = script.Parent Music.SoundId = preloadurl .. IDNumber Music:Play() Music.Name = "Song #" .. songnumber end)
You are not getting the new text.
Enter = script.Parent.Enter preloadurl = "http://roblox.com/asset/?id=" songnumber = 0 Enter.MouseButton1Down:connect(function(clicked) local IDNumber = script.Parent.IdNumber.Text -- Get the current text local Music = Instance.new("Sound") songnumber = songnumber + 1 Music.Parent = script.Parent Music.SoundId = preloadurl .. IDNumber Music:Play() Music.Name = "Song #" .. songnumber end)