I've made an automatic door opener, and it works perfectly until I die. When I die it stops working and when I spawn in this error come Infinite yield possible on 'Workspace.Zelt3q:WaitForChild("HumanoidRootPart". Any ideas why? Thanks.
while wait() do
local plrs = game.Players:GetPlayers()
for i, plr in pairs(plrs) do
local char = plr.CharacterAdded:Wait()
local HRP = char:WaitForChild("HumanoidRootPart")
if not HRP then return end
local magnitude = (HRP.Position - sensor.Position).magnitude
if magnitude < 15 then
if isOpen then return end
isOpen = true
