Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile("cl_init.lua")
- AddCSLuaFile("shared.lua")
- include("shared.lua")
- function ENT:Initialize()
- self:SetModel("models/odessa.mdl")
- self:SetHullType(HULL_HUMAN)
- self:SetHullSizeNormal()
- self:SetNPCState(NPC_STATE_SCRIPT)
- self:SetSolid(2)
- self:CapabilitiesAdd(CAP_ANIMATEDFACE)
- self:SetUseType(SIMPLE_USE)
- self:DropToFloor()
- end
- function ENT:AcceptInput(n, a, c)
- if n == "Use" and c:IsPlayer() then
- a:SendLua( [[ chat.AddText(Color(255, 0, 0), "Hey! Im an NPC!") ]] )
- local button = ents.Create( "gmod_button" )
- if ( !IsValid( button ) ) then return end // Check whether we successfully made an entity, if not - bail
- button:SetModel( "models/props_c17/oildrum001.mdl" )
- button:SetPos( Vector( 0, 0, 100 ) )
- button:Spawn()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement