Hi, title explain what im trying to do pretty much. I’m trying to change the name of text buttons on dynamically and i’m not quite sure how to go about doing that. Here is code that I commented in so It can help explain what im trying to do better, just incase you need it.
local localBuildableframes = game.Players.LocalPlayer.PlayerGui.Backpack.BackpackUI.Frame:GetChildren() -- List of frames for i,v in pairs(localBuildableframes) do -- for each frame if v.Name == "TextButton" then -- check if its a text button for i,o in pairs(itemCategories['Buildables']) do -- this is where im confused, dont think i should have a for loop in a foor loop lol. print(o) -- this prints out the data twice, for the sake of space, its printing out (x,y,x,y) v.Text = o -- trying to set the text of the frame, to o, which would be x, and y. (not x,y,x,y) --[[v.MouseButton2Down:Connect(function() print('r u being clicked') v:Destroy() RemoveItem:InvokeServer(o) end)]]-- end end end
This is the end result.
(should say buildables_table1 and 2, not 1 twice. this is happening because of the for loop above)
I understand why this isnt working, but im not sure how to go about properly doing it.