Added basic crafting

master
AlmTech Software 5 years ago
parent bc0a0d4872
commit 95bced1cda
  1. 4
      gamemode/engine/lib/server/sv_crafting.lua
  2. 1
      gamemode/engine/lib/sh_recipe.lua
  3. 2
      gamemode/settings/sh_recipes.lua
  4. 3
      gamemode/settings/sh_settings.lua

@ -44,9 +44,13 @@ function Quantum.Server.Crafting.MakeItem( pl, itemid )
for k, reqItem in pairs( recipe.recipe ) do for k, reqItem in pairs( recipe.recipe ) do
print( "##", k, reqItem.item ) print( "##", k, reqItem.item )
Quantum.Server.Inventory.RemoveSlotItem( pl, char, k, reqItem.amount )
end end
-- create item -- create item
Quantum.Server.Inventory.GiveItem( pl, recipe.creates, recipe.amount )
end) end)
else else

@ -22,6 +22,7 @@ function Quantum.Recipe.Add( itemid, station, tbl )
} }
Quantum.Recipes[ itemid ] = returnTbl Quantum.Recipes[ itemid ] = returnTbl
Quantum.Recipes[ itemid ].delay = math.Clamp( Quantum.Recipes[ itemid ].delay, Quantum.MinCraftDelay, Quantum.MaxCraftDelay )
return returnTbl return returnTbl
end end

@ -6,7 +6,7 @@
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ -- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
Quantum.Recipe.Add( "potatoe", nil, { Quantum.Recipe.Add( "potatoe", nil, { --Quantum.Server.Crafting.MakeItem( Entity(1), "potatoe" )
name = "Legendary Potatoe Recipe", name = "Legendary Potatoe Recipe",
amount = 1, amount = 1,
recipe = { recipe = {

@ -23,6 +23,9 @@ Quantum.ItemPickupTime = 0.5 -- seconds
Quantum.HolsterTime = 1 -- seconds Quantum.HolsterTime = 1 -- seconds
Quantum.MinCraftDelay = 2
Quantum.MaxCraftDelay = 60
Quantum.Money = { Quantum.Money = {
Prefix = "$", Prefix = "$",
Surfix = "" Surfix = ""

Loading…
Cancel
Save