Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. AddCSLuaFile("cl_init.lua")
  2. AddCSLuaFile("shared.lua")
  3.  
  4. include("shared.lua")
  5.  
  6. function ENT:Initialize()
  7. self:SetModel("models/odessa.mdl")
  8. self:SetHullType(HULL_HUMAN)
  9. self:SetHullSizeNormal()
  10. self:SetNPCState(NPC_STATE_SCRIPT)
  11. self:SetSolid(2)
  12. self:CapabilitiesAdd(CAP_ANIMATEDFACE)
  13. self:SetUseType(SIMPLE_USE)
  14. self:DropToFloor()
  15.  
  16. end
  17.  
  18. function ENT:AcceptInput(n, a, c)
  19. if n == "Use" and c:IsPlayer() then
  20. a:SendLua( [[ chat.AddText(Color(255, 0, 0), "Hey! Im an NPC!") ]] )
  21.  
  22. local button = ents.Create( "gmod_button" )
  23. if ( !IsValid( button ) ) then return end // Check whether we successfully made an entity, if not - bail
  24. button:SetModel( "models/props_c17/oildrum001.mdl" )
  25. button:SetPos( Vector( 0, 0, 100 ) )
  26. button:Spawn()
  27.  
  28. end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement