Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Custom Inventory Cloning same thing twice?

Asked by
NGC4637 602 Moderation Voter
3 years ago
Edited 3 years ago

Basically, I'm making a Custom Inventory Gui. Theres a bug where it shows 2 of the same item, even though I don't want it to.

I've tried clearing the 2 tables in this script before the cloning process. I've tried adding wait() arguments (that just made things worse lol).

this is the script:

001local player = game.Players.LocalPlayer
002local character = player.Character
003local items = {}
004local buttons = {}
005local equipped = script.Parent.Handler.Equipped
006local selected = script.Parent.Handler.Selected
007local location = script.Parent.Handler.Location
008game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false) -- Makes the original backpack gui invisible
009 
010player:WaitForChild("Backpack")
011 
012script.Parent.Parent.Parent:WaitForChild("PlayerMain")
013 
014function search(location)
015    for i,v in ipairs(location:GetChildren()) do -- Find all item in a specific location
View all 120 lines...

this is the few parts that this script interacts with:

a peek on the explorer

Picture of the bug (in case you don't understand what i mean)

0
no errors in the dev console btw NGC4637 602 — 3y
0
and, said script is a local script. It is called "InventoryHandler", you can see in the image i put NGC4637 602 — 3y

1 answer

Log in to vote
0
Answered by
NGC4637 602 Moderation Voter
3 years ago

nvm, this was never the backpack scripts problem, my items just somehow duped. I knew after I checked the backpack for any extra items.

lel

Ad

Answer this question