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

How do I make Size of a part expand constantly while in game?

Asked by 8 years ago

I want my part to expand using vector3 or CFrame when I play the game And I don't want to just keep pressing disable and enable script

1 answer

Log in to vote
3
Answered by
Scriptree 125
8 years ago

If you want to keep it going forever you can use a while true do loop as follows:

local part = script.Parent --- Change this to whatever the part is under

while true do
    part.Size = part.Size + Vector3.new(1,1,1) -- this will expand the part 1 stud on each axis every .5 seconds, change the 1's to any number you want the part to resize by.
    wait(.5) -- edit the wait to whatever
end

If you want to keep it going for a limited number of times you can use a for loop as follows:

local part = script.Parent -- Change this to whatever the part is under

for i = 1,20 do -- edit the 20 to how many times you want the following code to happen
    wait(.5) 
    part.Size = part.Size + Vector3.new(1,1,1) -- this will expand the part 1 stud on each axis 20 times every .5 seconds, change the 1's to any number you want the part to resize by.
end

Hope that helped :D

Ad

Answer this question