I use to use this door for a old group game. but the script wont open the door and keeps popping out a error on me not sure what's going on here.
error is,
Workspace.Model.DOOR.Model.Door.Detector.detect:10: attempt to index field 'Character' (a nil value)
local distance = 14 local width = 6 local check = 0 local open = false while true do for k,v in pairs(game.Players:GetChildren()) do if (script.Parent.Position - v.Character.Torso.Position).magnitude < distance then check = check + 1 end end if check >= 1 then if open == false then open = true for i = 0,width*2 do for a,b in pairs(script.Parent.Parent:GetChildren()) do if b.Name == "b1" then b.CFrame = b.CFrame * CFrame.new(0,0,-0.5) else if b.Name == "a1" then b.CFrame = b.CFrame * CFrame.new(0.5,0,0) else if b.Name == "c1" then b.CFrame = b.CFrame * CFrame.new(0,0,0.5) end end end end wait(0.05) end end else if check == 0 then if open == true then open = false for i = 0,width*2 do for a,b in pairs(script.Parent.Parent:GetChildren()) do if b.Name == "b1" then b.CFrame = b.CFrame * CFrame.new(0,0,0.5) else if b.Name == "a1" then b.CFrame = b.CFrame * CFrame.new(-0.5,0,0) else if b.Name == "c1" then b.CFrame = b.CFrame * CFrame.new(0,0,-0.5) end end end end wait() end end end end check = 0 wait() end
fixed by setting the game settings to r6, thanks to vxpper, for a asking me if I was using r6 are r15 had the game set to player choice, once I changed it to r6 the issue was solved.