Help with getting 4 parts to copy the other 4 parts CFrame

I have 2 Folder and each has an Object called Ball (Soccer Ball) I don’t know how to make the other folder to get to the Soccer Ball folder’s part CFrame

image

local ClientControlBall = game.Workspace.SoccerBall.ClientControlBall
local SoccerBall = game.Workspace.SoccerBall

for i,ClientBall in pairs(ClientControlBall:GetChildren()) do
    if ClientBall:IsA("BasePart") then
        for _,ServerBall in pairs(SoccerBall:GetChildren()) do
            if ServerBall:IsA("BasePart") then
                ClientBall.CFrame = ServerBall.CFrame
            end
       end
    end
end

I would Recommend naming the balls something like:
Ball1
Ball2
OtherBall1
OtherBall2

for number, CBall in ClientControlBall:GetChildren() do
    if CBall:IsA("BasePart") then
        CBall.CFrame =  SoccerBall["Other"..tostring(CBall)].CFrame
    end
end

Or, have them the same name

CBall.CFrame =  SoccerBall[CBall].CFrame

I tried this but it just follows to one Ball I’m trying to get the Ball to follow the ball that is outside of the Folder of ClientControlBall so it follows the one that’s inside SoccerBall instead. :confused:

https://gyazo.com/a6e07e332ac06b06ec8296f583bdd438

Like i said rename them, the Game will get confused if they are all the same name

This time I re-named to Other on the ball outside of the ball no matter what it’s still on the same position.

local ClientControlBall = game.Workspace.SoccerBall.ClientControlBall
local SoccerBall = game.Workspace.SoccerBall

for number, CBall in ClientControlBall:GetChildren() do
    if CBall:IsA("BasePart") then
        CBall.CFrame =  SoccerBall["Other"..tostring(CBall)].CFrame
    end
end

image

oh my god…

DO THIS:

Inside ClientControlBall:
Name a Ball: Ball1 and so on…

Inside SoccerBall:
Do the exact same thing,

You should have Ball1 - Ball5 within both folders, so then you do:

for number, CBall in ClientControlBall:GetChildren() do
    if CBall:IsA("BasePart") then
        CBall.CFrame =  SoccerBall[CBall].CFrame
    end
end

so u want me to name all of them Ball1 2 3 4 5???

if that’s the solution I don’t want that cause I’m not gonna be keeping the client control balls in the folder I’m gonna be spawning them later on.

If you want to copy the CFrame of the Soccer Balls, you should do that

the naming them all the same thing is so it will copy the Position of the Item with the Same name

Nevermind. I figured it myself. instead of naming them through 1 2 3 4 5 infinitely ima just save the SoccerBall’s CFrame to a table. thanks for the help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.