Hello! I have been trying for 2 days to get my sliding door to open and close, It opens great but zooms out the building when it closes.. I have looked everywhere and have not found anything and am too lazy to attempt anything else unless this just won't work here is the code:
Debounce = false
script.Parent.PrimaryPart = script.Parent.Center
script.Parent.Parent.Dectector1.Touched:Connect(function()
if not Debounce then
Debounce = true
for i=6,38 do
wait()
script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame + Vector3.new(.1,0,0))
end
end
wait(2)
for i=6,38 do
wait()
script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame -Vector3.new(.1,0,0))
Debounce = true
end
end)
Any help would be nice Thanks
