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

Bad argument # 3 (string expected, got nil)? Whats is?

Asked by 7 years ago

The script gives the error a bad argument # 3 (string expected, got nil), although everything went well. what is the problem?

1while true do
2        local numberr = script.Parent.InfoFrame.Nowicon
3        script.Parent.InfoFrame.TopicFrame.InfoText.Text = genresname[numberr.Value]
4        script.Parent.InfoFrame.Desc.Text = genresdesc[numberr.Value]      
5    wait()
6end

1 answer

Log in to vote
1
Answered by 7 years ago
1while true do
2        local numberr = script.Parent.InfoFrame.Nowicon
3        script.Parent.InfoFrame.TopicFrame.InfoText.Text = tostring(genresname[numberr.Value])
4        script.Parent.InfoFrame.Desc.Text = tostring(genresdesc[numberr.Value])
5    wait()
6end

Sometimes string and numbers don't work out together. If you want a number to go into text you use tostring() if you want text to go into a number use tonumber()

Ad

Answer this question