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
}
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"
}
hey you! have you ever heard of enes? if you are in trouble, better call enes!