How do I get this to loop?
local a = script.Parent.Parent.DP1
local b = script.Parent.Parent.DP2
function onClicked(onClicked)
for i=1, 150 do
a.CFrame = a.CFrame+Vector3.new(0, 0, 0.1)
b.CFrame = b.CFrame+Vector3.new(0, 0, -0.1)
wait(0.01)
end
print('Door 3 Moving')
wait(1)
repeat
a.CFrame = a.CFrame+Vector3.new(0, 0, -0.1)
b.CFrame = b.CFrame+Vector3.new(0, 0, 0.1)
wait(0.01)
until a.Position.Z <=508.4
print('Door 3 Moved')
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
-Its just roblox... Deal with it- |