Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isn't my script working correctly?[ANSWERED]

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)

2 comments

0

The end on line 12 is not needed.

0

That is not true, the end is needed for line 5.

1 answer

✓ Accepted answer

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)

1 comment

0

Oh my god thank you so much XD

This discussion is preserved as it was. New answers, comments, and votes are closed.