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

Bad Argument Errors [?] Click For Detail.

Asked by 6 years ago

Hello.

I got this error in a few lines;

local String = CB.Text.Value 
local Length = string.len(String)

This is only Part of my script.

CB is a text label. Text is a string value.

This is what the error said;

string expected got nil. near 'len'

If you know a way to fix it then please help with examples.

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

ROBLOX checks for properties before children of instances.

Change the name of Text to something more descriptive.

You're using .Value on the string of the text currently.

P.S: Just use #string to get the length

Ad

Answer this question