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 6 years ago

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

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

1 answer

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

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