local function remove_item(item)
local itemIcon = ItemsUI:FindFirstChild(item.Name)
if itemIcon then
itemIcon:Destroy()
end
end
-- Najpierw dodaj istniejące tool'e
for _, child in ipairs(backpack:GetChildren()) do
add_item(child)
end
for _, child in ipairs(char:GetChildren()) do
if child:IsA("Tool") then
add_item(child)
end
end
-- Potem dopiero nasłuchuj nowych
backpack.ChildAdded:Connect(function(child)
if child:IsA("Tool") then
add_item(child)
end
end)
char.ChildAdded:Connect(function(child)
if child:IsA("Tool") then
add_item(child)
end
end)
itemEvent.OnClientEvent:Connect(function(item)
remove_item(item)
end)
** You are now Level 3! **