Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. cl_init.lua
  2. net.Receive("doc012-1", function(len)
  3. local frame = vgui.Create("DFrame")
  4. frame:MakePopup()
  5. frame:SetSize(ScrW() * 0.521, ScrH() * 0.833)
  6. frame:Center()
  7. frame:SetTitle("SCP-012 Information")
  8.  
  9. local scroll = vgui.Create("DScrollPanel", frame)
  10. scroll:SetSize(ScrW() * 0.495, ScrH() * 0.787)
  11. scroll:SetPos(ScrW() * 0.026, ScrH() * 0.037)
  12.  
  13. local img = vgui.Create("DImage", scroll)
  14. img:SetSize(ScrW() * 0.469, ScrH() * 0.926)
  15. img:SetImage("item/Doc012.jpg")
  16. end
  17.  
  18.  
  19.  
  20.  
  21. shared.lua
  22. ENT.Type = "anim"
  23. ENT.Base = "base_gmodentity"
  24.  
  25. ENT.PrintName= "SCP-012 Information"
  26. ENT.Spawnable = true
  27. ENT.AdminSpawnable = false
  28. ENT.Category = "Documents"
  29. ENT.ID = "Doc-012"
  30.  
  31.  
  32.  
  33. init.lua
  34. AddCSLuaFile( "cl_init.lua" )
  35. AddCSLuaFile( "shared.lua" )
  36. include('shared.lua')
  37. util.AddNetworkString("doc012-1") -- Must write it to declare the "path"
  38.  
  39. function ENT:Initialize()
  40. self:SetModel( "models/props_mvm/clipboard.mdl" )
  41. self:PhysicsInit( SOLID_VPHYSICS )
  42. self:SetMoveType( MOVETYPE_VPHYSICS )
  43. self:SetSolid( SOLID_VPHYSICS )
  44. local phys = self:GetPhysicsObject()
  45. if (phys:IsValid()) then
  46. phys:Wake()
  47. end
  48. self.HP = 100
  49. self:SetUseType( SIMPLE_USE )
  50.  
  51. end
  52.  
  53. function ENT:OnTakeDamage( damage )
  54. self.HP = self.HP - 25
  55. if ( self.HP <= 0 ) then
  56. self:Remove()
  57. end
  58. end
  59.  
  60. function ENT:Use( ply, caller )
  61. net.Start( "doc012-1" ) -- Active the net name
  62. net.Send(ply) -- Send the signal to the (ply) <- Player
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement