Hey, I am currently doing a lot of sanity checks for my script. As I have to be 100% sure that no errors will occur. So, the way I am doing it currently is by using embedded if statements. But it’s quite tedious and I end up with (literally) hundreds of end
s all over the place.
An example would be like the one below;
I want to make sure that the character is a real player and has a humanoid, then I want to make sure (if it’s a real player) that the player is not dead.
if character:FindFirstChild("Humanoid") then
if character.Humanoid.Health ~= 0 then
end
end
You see where I am going? It’s really bad. So I was wondering if there are any other ways. And yes:
if character:FindFirstChild("Humanoid") and character.Humanoid.Health ~= 0 then
end
Does not work, as it would error if the first statement is false. Thanks, I am looking forward to feedback!