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

Personal Server Nil Value? Help Please!

Asked by 8 years ago

To check if a PS value is nil or is removed is it this?

if game.Workspace:FindFirstChild("PSVariable") and game.Workspace.PSVariable:IsA("NilValue") then

Thanks For Your Help!

1 answer

Log in to vote
1
Answered by 8 years ago

Well the first part , game.Workspace:FindFirstChild("PSVariable"), checks if the value is true and the other checks if it's false. Meaning, no matter if the value is there or not the rest of the code won't run. So you must change part one to check if it equals false, "Or nil". Or you could just add a not to the front. Example,

if not game.Workspace:FindFirstChild("PSVariable") then
    --do stuff when value is nil
else
    -- do stuff when the value is true
end

I'm not sure if that's what you were asking but I tried. Good luck!

0
/\ Thanks I'm gonna try it EvolutionaryCode 15 — 8y
Ad

Answer this question