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

Can I Have Two or More Arguments to a For Loop?

Title ^

Example.

for _,z in next,(tab) do
		wait()
z:TweenPosition(UDim2.new(z.Position), 'In', 'Bounce', 0.2, false)
end

What I want to do...

for _,z in next,(tab), (positions) do
		wait()
z:TweenPosition(UDim2.new(positions), 'In', 'Bounce', 0.2, false)
end

I know that this won't work but is there a way to do it properly?

4 comments

0

Please fix your formatting in your question.

0

Fixed.

0

What's wrong with the first way, and what difference in functionality are you looking for..?

0

I want a script where it gathers all of the children in a Frame (which happen to be other frames called "Particles") and then save their position at that EXACT moment to a table so I can use it later to tween them back to their original position, but soo far the tweening procecss is bugged 'cause it keeps tweening them to the current position instead of the position of the table at the beginning.

1 answer

local positions = {} 
for_,z in pairs(tab) do 
	table.insert(tabl, {z, z.Positon}) 
end 
for _,z in ipairs(positions) do 
	wait()
	z[1]:TweenPosition(UDim2.new(z[2]), 'In', 'Bounce', 0.2, false)
end

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