Line 133 is the one where the print() command that I used to detect this error
All I could do for checking nil is to set it to a default number, which I already did it on the server side script for placing a part on the shape and material
I always typed in numbers from the number pad, but it still did not detect the number correctly but it fixes itself the more the script is used.
The server(Normal scripts) can’t see the textBox.Text. Only localscript. If you want to a script have the textBox.Text, you need to recive it from a remoteFunction.
The script you see is a LocalScript, it sends the information of the GUI to a RemoteEvent to a ServerScript which detects who is running it, and if the person is not a moderator, they get permanently banned.
This is a bad practice. Avoid not when you’re using eqality operators. You should just use the opposite quality operator.
a == b
a ~= b -- not (a == b)
a >= b
a < b -- not (a >= b)
It’s cleaner to read and it has one less opcode so it is technically more efficient, but the big reason is because when you write this
not a == b
the interpreter evaluates it as
(not a) == b
This is due to the Operator Precedence. It’s the order of operations, like PEMDAS, for programming languages. In Lua, unary operators such as not come right after exponents:
parentheses
exponents ( ^ )
unary operators ( not x, -x )
multiplication and division
addition and subtraction
concatenation ( .. )
relational / equality ( ==, ~=, >, <=, etc )
logical and ( i.e. if x and y then )
logical or
And so your example would end up doing this.
if (not textbox.Text) == nil then
(not textbox.Text) is always going to be either true or false, never nil, so this condition will never run.