If I were to put this in a script:
script.Parent.StringValue.Value = nil
What would happen? Would the value change to ""? Would the script error?
If I were to put this in a script:
script.Parent.StringValue.Value = nil
What would happen? Would the value change to ""? Would the script error?
Depends on the type of value object.
Object Values become nil.
String Values become nil.
Bool Values become false.
Number Values become 0.
Int Values become 0.
CFrame Values error unless CFrame.new(nil) is used, if so they become 0, 0, 0.
Vector3 Values error unless Vector3.new(nil) is used, if so they become 0, 0, 0.
Color3 Values error unless Color3.new(nil) is used, if so they become 0, 0, 0.
BrickColor3 Values error unless BrickColor.new(Color3.new(nil)) is used, if so they become Really black.
Ray Values error unless Ray.new(nil) is used, if so they become {0, 0, 0}, {0, 0, 0}
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
So in a StringValue, if I used string.len after setting the Value to nil, it would come up as 0?
Correct, because it has no length!
Fantastic, thanks for your help!
No problem :)