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

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

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

✓ Accepted answer
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()

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