Value ~= nil broken for some reason

Well I created a Value and basically here is a rundown of how the script is similar to:

local Value = script.Value-- The Value would be the name of the Value
if Value.Value ~= nil then
    --do code here
end

for some reason, it doesn’t go through and the thing is that I created it and haven’t altered with the value. Even “” instead of nil isn’t working. I can’t figure out the problem.

Could you tell us what ClassName is the value instance (e.g. is the object script.Value a BoolValue, ObjectValue)?

Nevermind I am dumb. I realised nil can’t be used for a StringValue so I was twisting the code so much that it broke. All I had to do was “replace” the nil with “”
:smiley:

1 Like

Yeah, for “StringValue” instances an empty string value "" is a good way to represent no value.