Trying to make a basic code door.. it works but the blocks wig out when I try to shrink them. I basically want them to "slide up", and to create this effect while not making surrounding scenery look weird, I need to shrink them from the bottom up. My following code does not work and I have no idea why, any insight?
local function OpenDoor()
LeftDoor.CanCollide = false;
RightDoor.CanCollide = false;
for Key = 0, 1, 0.01 do
LeftDoor.Size = (LeftDoor.Size - Vector3.new(0, Key, 0));
RightDoor.Size = LeftDoor.Size
LeftDoor.CFrame = (LeftDoor.CFrame * CFrame.new(0, (Key / 2), 0));
RightDoor.CFrame = (RightDoor.CFrame * CFrame.new(0, (Key / 2), 0));
wait(1 / 15);
end;
end;
local function CloseDoor()
for Key = 0, 1, 0.01 do
LeftDoor.Size = (LeftDoor.Size + Vector3.new(0, Key, 0));
RightDoor.Size = LeftDoor.Size
LeftDoor.CFrame = (LeftDoor.CFrame * CFrame.new(0, -(Key / 2), 0));
RightDoor.CFrame = (RightDoor.CFrame * CFrame.new(0, -(Key / 2), 0));
wait(1 / 15);
end;
LeftDoor.CanCollide = true;
RightDoor.CanCollide = true;
end;

2 comments
Your gonna bother to put semicolons to end lines on every line besides line 16 and line 6?
Wow, thanks for completely missing my point. It was a mistake because I was c+p'ing. Great help, jackass.