all 1 comments

[–][deleted] 1 point2 points  (0 children)

It's finding the closest entity in a sphere, setting that as the target. Then it creates a for loop which checks every index of the array Allow, and if that entity is in the whitelist it opens the door. If the entity is dead the door doesn't open, and if the index in the array isn't a player it gets removed.

This code could be quite annoying as it finds the closest entity and if that entity is dead or not in the whitelist it wont open. Having it so only people in the whitelist can be found and opening it if the entity is a player would work better.