"Argument 1 missing or nil"

--[[Services]]--
local ContextActionService = game:GetService("ContextActionService")
local RunService = game:GetService("RunService")

local ItemModule = require(game.ReplicatedStorage.ItemModule)
local Items = ItemModule.Items
local PlayerData = require(game.ReplicatedStorage.ClientData)

--[[Constants]]--
--Objects
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Character = plr.Character or plr.ChildAdded:Wait()

--UI
local InventoryGui = script.Parent
local InventorySlotGui = InventoryGui.Slots
local InventorySlotGrid = InventorySlotGui.UIGridLayout

local LeftHandSlot = InventoryGui.LeftHandSlot
local RightHandSlot = InventoryGui.RightHandSlot

local HeadSlot = InventoryGui.HeadSlot
local ChestSlot = InventoryGui.ChestSlot
local LegSlot = InventoryGui.LegSlot
local BootSlot = InventoryGui.BootSlot

local GeneralGui = script.Parent.Parent.Parent.General
local HotBarGui = GeneralGui.HotBar
local HotBarFrame = HotBarGui.Frame

local UIAssets = game.ReplicatedStorage.Assets.UI
local InventorySlotModel = UIAssets.InventorySlot

local UIVariables = game.ReplicatedStorage.Variables.Player.UI

--Events
local Events = game.ReplicatedStorage.Events
local DataEvents = Events.Data
local DataUpdated = DataEvents.DataUpdated
local PlayerAction = Events.PlayerAction

--Non Objects
local StartCanvasSize = InventorySlotGui.CanvasSize
local StartGridSize = InventorySlotGui.Size
local StartGridPos = InventorySlotGui.Position

local CellSizeWeight = UIVariables.CellSizeWeight.Value
local PaddingWeight = UIVariables.PaddingWeight.Value
local CellSize = UIVariables

local InventorySize = #PlayerData.SlotData.Inventory
local RowSize = 4

local ViewSizeX = 0
local ViewSizeY = 0

local SpacingDistance = 1
local Spacing = Vector3.new(SpacingDistance, SpacingDistance, SpacingDistance)
local ItemCameraCFrame = CFrame.new(Spacing)*CFrame.lookAt(Spacing, Vector3.new(0, 0, 0))


--[[Variables]]--
local InventoryFrameSize 

local InventorySlotSize
local InventorySlotPadding

local InventorySlotFrameData = {}
local HotBarSlotFrameData = {}
1 Like

Hey uh sorry to ask but what is “SlotFrameData”?

I use it to tell what data is displayed in each slot so i can compare it to the new data and make changes as needed

How does the script know what it is?

You should probably just attempt to make your own system instead of examining mine. Trial and error will help you learn way better than analyzing my scripts

yes, im making a script right now I was just wondering what it was since i use your script for reference

local function LoadData(Armor, ArmorData)
	
	local template = game.StarterGui.MainGui.InventoryHolder.Inventory.Templates.Template
	local newTemplate = template:Clone()
	local ArmorName = armormodule.armors.Name
	
	local Viewport = game.StarterGui.MainGui.InventoryHolder.Inventory.Templates.Template.ViewportFrame
	local OldArmor = Viewport:FindFirstChild("Model")
	local ArmorModule = require(game.ReplicatedStorage:WaitForChild("ArmorHandler"))
	local Armor = ArmorModule.armors
	local plr = game.Players.LocalPlayer
	local IsEmpty = ArmorName == ""
	local char = plr.Character or plr.ChildAdded:Wait() 
	
	

	
end

Its used to make the process of updating the gui a tiny bit more efficient. I would not bother trying to understand what it does when you don’t have a working system yet

wdym working system? I already have all the armor and the armor drops set up and the inventory i justr need to save it

Oh. For saving you should make a different system that handles data saving and reading entirely on its own and then have the inventory read that data

the thing is im not sure how to do it so i just use your system for reference if thats ok with you

My system for the inventory does not have anything to do with data saving. That’s another script entirely. And even if you don’t know how to do something. Just attempt to do it. The Api will help you a lot

Then why did you send that script before?

You asked for the inventory script and I assumed it meant the script for the Gui. I usually reference a DataManager script for data saving

I thought that was similar to datasaving