Skip to content

Instantly share code, notes, and snippets.

@Mkeefeus
Created February 20, 2023 18:07
Show Gist options
  • Save Mkeefeus/4e71e157ba9f36c6380155e267adcb03 to your computer and use it in GitHub Desktop.
Save Mkeefeus/4e71e157ba9f36c6380155e267adcb03 to your computer and use it in GitHub Desktop.
addCommand thoughts
lib.addCommand({
name = {'additem', 'giveitem'},
description = "Give an item to a player",
groups = {'admin', 'moderator'},
args = {
{
name = "target",
description = "Server ID",
type = "number",
required = true
},
{
name = "item",
description = "Name of the item to give",
type = "string",
required = false
},
{
name = "count",
description = "Amount of the item to give, leave blank for 1",
type = "number",
required = false
},
{
name = "metatype",
description = "Metatype of the item",
type = "string",
required = false
}
},
}, function(source, args)
args.item = Items(args.item)
if args.item and args.count > 0 then
Inventory.AddItem(args.target, args.item.name, args.count, args.metatype)
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment