Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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)

0
The end on line 12 is not needed. Perci1 4988 — 10y
0
That is not true, the end is needed for line 5. deputychicken 226 — 10y

1 answer

Log in to vote
1
Answered by
SirNoobly 165
10 years ago

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)
0
Oh my god thank you so much XD deputychicken 226 — 10y
Ad

Answer this question