Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cl_init.lua
- net.Receive("doc012-1", function(len)
- local frame = vgui.Create("DFrame")
- frame:MakePopup()
- frame:SetSize(ScrW() * 0.521, ScrH() * 0.833)
- frame:Center()
- frame:SetTitle("SCP-012 Information")
- local scroll = vgui.Create("DScrollPanel", frame)
- scroll:SetSize(ScrW() * 0.495, ScrH() * 0.787)
- scroll:SetPos(ScrW() * 0.026, ScrH() * 0.037)
- local img = vgui.Create("DImage", scroll)
- img:SetSize(ScrW() * 0.469, ScrH() * 0.926)
- img:SetImage("item/Doc012.jpg")
- end
- shared.lua
- ENT.Type = "anim"
- ENT.Base = "base_gmodentity"
- ENT.PrintName= "SCP-012 Information"
- ENT.Spawnable = true
- ENT.AdminSpawnable = false
- ENT.Category = "Documents"
- ENT.ID = "Doc-012"
- init.lua
- AddCSLuaFile( "cl_init.lua" )
- AddCSLuaFile( "shared.lua" )
- include('shared.lua')
- util.AddNetworkString("doc012-1") -- Must write it to declare the "path"
- function ENT:Initialize()
- self:SetModel( "models/props_mvm/clipboard.mdl" )
- self:PhysicsInit( SOLID_VPHYSICS )
- self:SetMoveType( MOVETYPE_VPHYSICS )
- self:SetSolid( SOLID_VPHYSICS )
- local phys = self:GetPhysicsObject()
- if (phys:IsValid()) then
- phys:Wake()
- end
- self.HP = 100
- self:SetUseType( SIMPLE_USE )
- end
- function ENT:OnTakeDamage( damage )
- self.HP = self.HP - 25
- if ( self.HP <= 0 ) then
- self:Remove()
- end
- end
- function ENT:Use( ply, caller )
- net.Start( "doc012-1" ) -- Active the net name
- net.Send(ply) -- Send the signal to the (ply) <- Player
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement