I want to get the name of a part and its position, and then add that to an array as a dictionary using code. Not sure how to do this, I can only get 1 key value to be added to the array.
CODE
local partsInGame = {}
local workPlace = game.Workspace:GetChildren()
for i, v in pairs(workPlace) do
if v.Name == "Part" then
part = v
partPos = part.Position
newTable = {
part = partPos
}
end
end
print(newTable)
OUTPUT
{
["part"] = 72.8760376, 0.5, -56.6282959
}
- Server - Script:30
there are 4 parts each named "Part" which needed to be added to the dictionary
DESIRED OUTPUT
{
["part"] = "position of part"
["part"] = "position of part"
["part"] = "position of part"
["part"] = "position of part"
}
- Server - Script:30
