Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Changing the Size of a Part.

Asked by 10 years ago

This may sound like a basic question but I need to know how to change the size of a part that is in the workspace.

local part = game.Worksace.Part1
while true do
--change size
wait()
end

I need to know the way to change the size.

3 answers

Log in to vote
2
Answered by
AxeOfMen 434 Moderation Voter
10 years ago
local part = game.Workspace.Part1
local delta = 1
while true do 
    part.Size = part.Size + Vector3.new(delta,delta,delta)
    wait()
end

Be careful! That's an infinite loop. You'll probably want a way to break out of it before the brick gets too large.

maybe while part.Size.X <= 200 do instead of while true do

Good luck!

Ad
Log in to vote
1
Answered by
nate890 495 Moderation Voter
10 years ago

Just to quickly add on to what AxeOfMe posted, when resizing parts you generally need to reposition the part to it's initial position (by changing it's new CFrame to its old CFrame) once the resizing has been done.

local part = game.Workspace.Part1
local oldcf = part.CFrame

while true do
    part.Size = part.Size + Vector3.new(1, 1, 1)
    part.CFrame = oldcf --reposition the part
    wait()
end
Log in to vote
-1
Answered by 10 years ago
local part = game.Worksace.Part1;
for i=1,100 do
part.Size=Vector3.new(i,i,i);
wait();
end

Answer this question