Problems in creating a certain number of instances for a given number of names that are in a dictionary

So I made a script that contains a dictionary with 3 names, and I would like to know how to do so that 3 instances are created with these respective names

I made a script related to this (which is not finished) however I don’t know if I should do it this way:

script:
local dictionary = {“name1”,“name2”,“name3”}

for i = 1,#dictionary do
–create the number of instances according to the number of names in the dictionary
end

In short: How do I create 3 instances for the respective name?

This should work:

local arr = {"name1", "name2", "name3"}
for ind, val in pairs(arr) do
      local inst = Instance.new(--[[Enter instance type here--]])
      inst.Name = val
      inst.Parent = workspace -- or wherever else you need.
end
1 Like

thank you, it seems that after all it was something simple