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

What's the name of this variable setting method?

I wanted to learn more about this, but i dont know the name.

local hum = part.Parent:FindFirstChildWhichIsA("Humanoid") or part.Parent.Parent:FindFirstChildWhichIsA("Humanoid")

Thank you for your help.

1 comment

0

As an addition if you really want to know the name of this assignment method. To be honest I don't think there really is one. The closest you could compare it to is a ternary (conditional) operation.

1 answer

✓ Accepted answer

In it's basis what this does is check if the value before the or is a truthy value (anything but nil). That means if there's no child which is a Humanoid then it will return nil. Additionally if the value before or is not a truthy value then it will use the value behind or.

1 comment

0

That's not exactly what i asked for, but thank you.

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