Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I group these two for loop functions into one?

function grow()
	for i = 1,120 do
	ball.size = ball.size + Vector3.new(.2,.2,.2)
	wait()
	
   end
end

function shrink()
	for i = 1,120 do
	ball.size = ball.size + Vector3.new(-.2,-.2,-.2)
	wait()
	
	end
end

3 comments

0

btw Im aware size whould be *Size

0

What do you want to do again... Make them run at the same time?

0

no I want the first for loop to run, and then the second over and over while the tool is equipped

1 answer

(click view all lines)


-- ball = script.Parent
	
function grow()
    for i = 1,120 do
    ball.Size = ball.Size + Vector3.new(.2,.2,.2)
    wait()
   end
end
function shrink()
    for i = 1,120 do
    ball.Size = ball.Size + Vector3.new(-.2,-.2,-.2)   
 	wait()
    end
end

--[[ 

while true do
	grow()
	shrink()
end

 ]]

looping your functions nonstop

This discussion is preserved as it was. New answers, comments, and votes are closed.