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.
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.
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.
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.
1 comment
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.