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

Using for loop to CFrame multiple PrimaryParts?

Asked by 8 years ago

so I'm making a minigame place, for a effect of the minigame loading, I want a barrier to come down infront of the window. For this I have created a table to put the names of the window models in and then loop through the lobby and the table, check if the childs name is the same as the value in the table, and then move each of their primaryparts down to the window.

I have tried this, but it seems to ignore the loop completely (no pause, but Correct! is printed)

Can I have some help please?

for _, win in pairs(windows) do for _, win2 in pairs(workspace.Lobby:GetChildren()) do if win2.Name == win then print("Correct!") for it = win2:GetPrimaryPartCFrame().Y, 47.923, -.05 do win2:SetPrimaryPartCFrame(win2:GetPrimaryPartCFrame() * CFrame.new(0,it,0)) wait(0.05) end end end end

0
Please format your code using the Lua Block. Highlight all of your code, and click on the 'Lua' button. Also lineup all of your code correctly User#9949 0 — 8y

Answer this question