local Aut1 = game.Workspace.Door.Aut1 local Aut2 = game.Workspace.Door.Aut2 function OnTouch(part) debounce = false local humanoid = part.Parent:findFirstChild("Humanoid") if Humanoid ~= nil then Aut1.Position = vector3.new(Aut1.Position.x, Aut1.Position.y, Aut1.Position.z+5) Aut2.Position = vector3.new(Aut1.Position.x, Aut2.Position.y, Aut2.Position.z-5) wait(5) Aut1.Position = vector3.new(Aut1.Position.x, Aut1.Position.y, Aut1.Position.z-5) Aut2.Position = vector3.new(Aut2.Position.x, Aut2.Position.y, Aut2.Position.z+5) print("The Script Works") end end
Line 7: You defined a variable called 'humanoid'. The error is caused in line 7: which is that you used "Humanoid" instead of "humanoid". Computers are stubborn in a way when reading code of any sort, and everything is case-sensitive.