Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

is there a way to use the Negative of If?

 if char:FindFirstChild("ForceField") then

how do i make this negative? for example:

if char:FindFirstChild("ForceField") == false then

2 comments

0

i dont understand what you are you asking how to disable force feild

0

no, is there a way to say for example: if you don't find a forcefield then do this

2 answers

✓ Accepted answer

Just type "not" after if

if not char:FindFirstChild("ForceField") then

3 comments

0

^^

0

tried already and it doesn't work because findfirstchild returns nil

1

not (nil) evaluates to true in lua 5.3.4! And in ROBLOX Studio! @Elixcore please re-examine your logic in your code. if not char:FFC("Forcefield") then WILL run if Forcefield does NOT exist. If it is not running the code in the if statement then child ForceField exists.

If the forcefield is nil then

if char:FindFirstChild("ForceField") == nil then

This discussion is preserved as it was. New answers, comments, and votes are closed.