Sorry, but the title was a bit misleading, and although The code that I have isnt working, its more that i just dont know how to do it, I am trying to make it so that each textbuttons text gets changed to a tool in the players backpack, but only as many as the player has, but it just makes all of the textbuttons text the last tool that it went over.
local player = game:GetService("Players").LocalPlayer
local char = player.Character
while true do
task.wait(0.1)
for i, textbutton in ipairs(script.Parent:GetChildren()) do
if textbutton:IsA("TextButton") then
for i, v in ipairs(player.Backpack:GetChildren()) do
if v:IsA("Tool") then
local tool = v
if tool.ScrapValue then
if textbutton.Text == tool.Name.. " - ".. tool.ScrapValue.Value then
else
textbutton.Text = tool.Name.. " - ".. tool.ScrapValue.Value
end
end
end
end
end
end
end
robloxapp-20240719-1311472.wmv (2.7 MB)