"Attempt to concatenate field '?' (a userdata value)"?
01 | local OfficialLevels = game.Workspace.OfficialLevels:GetChildren() |
04 | for i = 1 ,#OfficialLevels do |
05 | local x = script.Template:Clone() |
06 | x.ListButton.Position = UDim 2. new( 1 , 0 ,( 0.2 * i), 0 ) |
07 | x.ListImage.Position = UDim 2. new( 0 , 0 ,( 0.2 * i), 0 ) |
08 | x.ListButton.Text = string.gsub(OfficialLevels [ i ] .Name, "_" , " " ) |
10 | x.ListButton.Name = OfficialLevels [ i ] .. "Button" |
11 | x.ListImage.Name = OfficialLevels [ i ] .. "Icon" |
12 | x.Parent = script.Parent |
13 | print ( "Completed " .. x.ListButton.Name .. " and " .. x.ListImage.Name) |
I get this error on line ten
10: attempt to concatenate field '?' (a userdata value)
But i'm not sure what it means.
I'm trying to make a list of all the values in OfficialLevels
with some of the information contained in them. I made a template
to be used for each item on the list which is parented to the script.
This is a server side script.