CFrame Problem and InPairs Problem

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? i want, make new part, and then I want Part.CFrame =
    1-4.CFrame,
    122333
    What solutions have you tried so far?
local a = 0
for i,v in pairs(game.Workspace.Player2.Troops:GetChildren())do --- i = 4
a += 1
      local a = Instance.new("Part")
      a.Parent = workspace
      a.CFrame = game.Workspace.a ---- Problem                       
  end

This will index as a part name “a”. To index the number use square brackets.

a.CFrame = game.Workspace[tostring(a)]
2 Likes