It Makes Two Frames Showing The Same Item When I Insert A Item Into PlayersItems Folder.
Script:
local Player = game.Players.LocalPlayer
local Inventory = script.Parent.Shadow.Inventory
local Item = script.Parent.Shadow.Item
local PlayerItems = script.Parent.PlayersItems
local GameItems = script.Parent.GameItems
local TotalItems = {}
local HasAItem = false
PlayerItems.ChildAdded:Connect(function(child)
if #TotalItems == 0 and not HasAItem then
HasAItem = true
local ItemF = Item:Clone()
ItemF.ItemImage.Image = "rbxassetid://"..child.Icon.Value
ItemF.Parent = Inventory
ItemF.Visible = true
table.insert(TotalItems,child.Name)
elseif #TotalItems < 7 then
local ItemF = Item:Clone()
ItemF.ItemImage.Image = "rbxassetid://"..child.Icon.Value
ItemF.Parent = Inventory
ItemF.Visible = true
table.insert(TotalItems,child.Name)
if #TotalItems >= 7 then
ItemF:Destroy()
child:Destroy()
end
else
local ItemF = Inventory[child.Name]
if ItemF then ItemF:Destroy() end
child:Destroy()
print("Max Inventory Space!")
end
end)
Doesn't Print A Error.
