The doors moves but not in the correct direction.It either flings away or slides in a 45 degrees angle.
I used two scripts for each door,one for the Right and Left.
Right Door script
debounce = false script.Parent.Touched:connect(function(hit) if debounce == true then return end debounce = true if hit.Parent:FindFirstChild("Humanoid") then for i = 1,40 do script.Parent.CFrame = script.Parent.CFrame + Vector3.new(-.5,0,0) wait() end wait(1) for i = 1,40 do script.Parent.CFrame = script.Parent.CFrame + Vector3.new(.5,0,0) wait() end end debounce = false end)
Left Door script
debounce = false script.Parent.Touched:connect(function(hit) if debounce == true then return end debounce = true if hit.Parent:FindFirstChild("Humanoid") then for i = 1,40 do script.Parent.CFrame = script.Parent.CFrame + Vector3.new(.5,0,0) wait() end wait(1) for i = 1,40 do script.Parent.CFrame = script.Parent.CFrame + Vector3.new(-.5,0,0) wait() end end debounce = false end)
The Right and Left door's script is the same except the Vectors are different. Any help?