Got this script from a sliding door I found, but being me I don't know most of what is going on in the script. I just need to know how and where to change the distance the doors move apart in the script.
door = script.Parent
door1 = door.Door1
door2 = door.Door2
button = door.Button
isopen = door.IsOpen
debounce = door.Debounce
button.ClickDetector.MouseClick:connect(function()
if (debounce.Value == false) then
if (isopen.Value == true) then
isopen.Value = false
elseif (isopen.Value == false) then
isopen.Value = true
end
button.BrickColor = BrickColor.new("Black")
end
end)
isopen.Changed:connect(function()
if (debounce.Value == false) then
debounce.Value = true
if (isopen.Value == true) then
for i=1, 190 do
door1.CFrame = door1.CFrame * CFrame.new(-0.1,0,0)
door2.CFrame = door2.CFrame * CFrame.new(0.1,0,0)
wait()
end
debounce.Value = false
button.BrickColor = BrickColor.new("Bright red")
return
end
if (isopen.Value == false) then
for i=1, 190 do
door1.CFrame = door1.CFrame * CFrame.new(0.1,0,0)
door2.CFrame = door2.CFrame * CFrame.new(-0.1,0,0)
wait()
end
debounce.Value = false
button.BrickColor = BrickColor.new("Bright green")
return
end
end
end)

3 comments
Thanks! This really helped.
Np, if you want me to explain how the script works, I can. So you understand what everything is on there.
Thanks, that would be very helpful.