#Custom Inventory Dont work

1 messages · Page 1 of 1 (latest)

whole lance
#

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)

#

it a rest of script

narrow rapids
#

what about it doesnt work

whole lance
#

nothink work

dense steepleBOT
#

studio** You are now Level 3! **studio

clear lodge
#

i see spelling errors, Roblox doesn’t have :HasTag, :AddTag, :RemoveTag by default. Loops Missing Variable Name Typos in Function Names

whole lance
#

but roblox has this functions

clear lodge
#

well ur making alota spelling errors

#

if itemIcon:HasTag("Equippted") then
itemEvent:FireServer(itemName, "Active")
else
itemEvent:FireServer(itemName, "Eqquipted")
itemIcon:AddTag("Eqquipted")
end

dense steepleBOT
#

studio** You are now Level 1! **studio

clear lodge
#

You wrote:

for , child in ipairs(backpack:GetChildren()) do

Lua syntax requires a variable before the comma:

for _, child in ipairs(backpack:GetChildren()) do