hello guys im currently making a backpack system or inventory system but i have problem its work properly when the tools already on starterpack but when i pick it up on game the inventory is not adding new frame
here the code
local bp = script.Parent
local holder = script.Parent:WaitForChild("Holder")
local scrolling = holder:WaitForChild("ScrollingFrame")
local items = scrolling:WaitForChild("Items")
local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local backpack = player.Backpack:GetChildren()
for i,v in pairs(backpack) do
warn(v)
print(i)
if v:IsA("Tool") then
local newitem = items:Clone()
newitem.Name = v.Name
newitem.Parent = scrolling
newitem.Visible = true
newitem:WaitForChild("Pic").Image = v.TextureId
newitem:WaitForChild("itemname").Text = v.Name
end
end
i need to reset my character to add the frame like that
some thing wrong on that??