RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a inventory system"
-- server script local Inventory = {} game.Players.PlayerAdded:Connect(function(player) Inventory[player.Name] = {} end) game.Players.PlayerRemoving:Connect(function(player) Inventory[player.Name] = nil end) function addItem(player, itemName) table.insert(Inventory[player.Name], itemName) end function removeItem(player, itemName) local items = Inventory[player.Name] for i,v in ipairs(items) do if v == itemName then table.remove(items, i) break end end end function getItems(player) return Inventory[player.Name] end