From 3347d78a48e08084606e8902d6580a025ab2f793 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 24 Oct 2016 12:09:46 -0400 Subject: Added a lootchest, still needs some items to drop! --- entities/entities/art_lootchest/cl_init.lua | 5 +++++ entities/entities/art_lootchest/init.lua | 24 ++++++++++++++++++++++++ entities/entities/art_lootchest/shared.lua | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 entities/entities/art_lootchest/cl_init.lua create mode 100644 entities/entities/art_lootchest/init.lua create mode 100644 entities/entities/art_lootchest/shared.lua diff --git a/entities/entities/art_lootchest/cl_init.lua b/entities/entities/art_lootchest/cl_init.lua new file mode 100644 index 0000000..4cfd132 --- /dev/null +++ b/entities/entities/art_lootchest/cl_init.lua @@ -0,0 +1,5 @@ +include('shared.lua') +--local invfuncs = include("../../../gamemode/shared/inventory_common.lua") +local invfuncs = ART.invfuncs + +ENT.RenderGroup = RENDERGROUP_BOTH diff --git a/entities/entities/art_lootchest/init.lua b/entities/entities/art_lootchest/init.lua new file mode 100644 index 0000000..516dc98 --- /dev/null +++ b/entities/entities/art_lootchest/init.lua @@ -0,0 +1,24 @@ +AddCSLuaFile( "cl_init.lua" ) +AddCSLuaFile( "shared.lua" ) + +include("shared.lua") +local invfuncs = include("../../../gamemode/shared/inventory_common.lua") + +--Some things that can be looted +local lootables = { + +} + +function CreateRandomLoot(time) + +end + +ENT.lastused = CurTime() +function ENT:Use(ply) + local nowtime = CurTime() + print("Last used time:",self.lastused,"now it's ",nowtime) + self.lastused = nowtime + print("Ply opened:",ply) + self.Openedby[ply] = true + self:SendInventory(ply) +end diff --git a/entities/entities/art_lootchest/shared.lua b/entities/entities/art_lootchest/shared.lua new file mode 100644 index 0000000..d99af27 --- /dev/null +++ b/entities/entities/art_lootchest/shared.lua @@ -0,0 +1,2 @@ +ENT.Type = "anim" +ENT.Base = "art_chest" -- cgit v1.2.3-70-g09d2