So basically it works but lets say there are 2 ppl in the door scanner and 1 of them exits it. It will close even though there is still a person there. How do i make it so that it doesnt close until there is no one inside the brick.
script.Parent.Touched:connect(function(hit)
if hit ~= nil then
game.Workspace.Door.BodyPosition.position = script.Parent.AYE.Value
end
end)
script.Parent.TouchEnded:connect(function(leave)
if leave.Name == "Head" or "Torso" or "Left Leg" or "Right Leg" or "Left Arm" or "Right Arm" ~= nil then
wait(1.5)
game.Workspace.Door.BodyPosition.position = script.Parent.BEE.Value
end
end)

5 comments
You may need to check line 11.
Yup. I'd just do game.Players:GetPlayerFromCharacter(script.Parent) or leave.Parent:FindFirstChild("Humanoid")
oh..never thought about that 0-0
Doesnt completely fix it but its much better
Yeah, I wasn't looking at that. I'll do that.