mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-16 21:33:46 +03:00
Upload
This commit is contained in:
50
lua/entities/chickenwrap/init.lua
Normal file
50
lua/entities/chickenwrap/init.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
AddCSLuaFile( "shared.lua" )
|
||||
include( 'shared.lua' )
|
||||
|
||||
function ENT:SpawnFunction( ply, tr )
|
||||
|
||||
if !tr.Hit then return end
|
||||
|
||||
local SpawnPos = tr.HitPos + tr.HitNormal * 1
|
||||
|
||||
local ent = ents.Create( "chickenwrap" )
|
||||
ent:SetPos( SpawnPos )
|
||||
ent:Spawn()
|
||||
ent:Activate()
|
||||
|
||||
return ent
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
|
||||
self.Entity:SetModel("models/FoodNHouseholdItems/chicken_wrap.mdl")
|
||||
|
||||
self.Entity:PhysicsInit( SOLID_VPHYSICS )
|
||||
self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
|
||||
self.Entity:SetSolid( SOLID_VPHYSICS )
|
||||
|
||||
|
||||
self.Index = self.Entity:EntIndex()
|
||||
|
||||
local phys = self.Entity:GetPhysicsObject()
|
||||
if phys:IsValid() then
|
||||
phys:Wake()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Use(activator)
|
||||
activator:SetHealth(activator:Health()+20)
|
||||
self.Entity:Remove()
|
||||
activator:EmitSound("eating_and_drinking/eating.wav", 50, 100)
|
||||
|
||||
end
|
||||
28
lua/entities/chickenwrap/shared.lua
Normal file
28
lua/entities/chickenwrap/shared.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.Base = "base_gmodentity"
|
||||
|
||||
ENT.PrintName = "Chicken Wrap"
|
||||
ENT.Author = "SaDow4100"
|
||||
ENT.Contact = "Steam"
|
||||
ENT.Purpose = "Food"
|
||||
ENT.Instructions = "E"
|
||||
ENT.Category = "Food"
|
||||
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
|
||||
function ENT:SetupModel()
|
||||
|
||||
self.Entity:SetModel("models/FoodNHouseholdItems/chicken_wrap.mdl")
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user