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

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

Asked by
lysandr 49
7 years ago
Edited 7 years ago

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?

0
Please fix your formatting in your question. PyccknnXakep 1225 — 7y
0
Fixed. lysandr 49 — 7y
0
What's wrong with the first way, and what difference in functionality are you looking for..? Goulstem 8144 — 7y
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. lysandr 49 — 7y

1 answer

Log in to vote
0
Answered by
blowup999 659 Moderation Voter
7 years ago
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
Ad

Answer this question