Skip to content

gtnardy/nanos-world-inventory-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nanos-world-inventory-system

Custom Inventory System inspired by CS:GO for nanos world

Usage

Keys 1 - 9 to switch Items, 0 to free hands. Picking up any Item will automatically place them in the inventory.

Scripting

-- Gives an AK47 Weapon to player (drops any other item which may be holding)
GiveInventoryItem(player, "nanos-world::SK_AK47")

-- Removes an Item from player's inventory at slot 1, will Drop the item if currently holding it
RemoveInventoryItem(player, 1)

If you want to add more Items/Weapons, just modify Shared/Index.lua and append your new items in the InventoryItems list, e.g.:

InventoryItems = {
	...
	["nanos-world::MyCustomAsset"] = { -- Asset Name, used to indentify the Item/Weapon
		name = "Awesome Custom", -- Custom name to appear on the screen
		image = "good_photo.png", -- Image path (inside UI/images/ folder)
		spawn = function(pos) return Weapon(pos or Vector(), Rotator(), ...) end, -- Spawn function to spawn your object
		slot = 1, -- Which slot to be placed
		type = InventoryTypes.Weapon, -- Kind of the item (Weapons handle ammo_bag and ammo_clip automatically)
		default_data = {ammo_bag = 1000, ammo_clip = 30}, -- Custom data attached to this Item
	},
	...
}

Images

AP5 (holding) + Glock + Grenade AR4 (holding) + Glock AR4 + Glock (holding)

About

Custom Inventory System inspired by CS:GO for nanos world

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks