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/items/quake1/alaser.mdl")
- self:SetCollisionGroup(COLLISION_GROUP_PROJECTILE)
- local mins, maxs = Vector(-8, -1, -1), Vector(8, 1, 1)
- self:PhysicsInitBox(mins, maxs)
- self:SetMoveType(MOVETYPE_VPHYSICS)
- self:SetSolid(SOLID_CUSTOM)
- self:DrawShadow(false)
- local glow = ents.Create("env_sprite")
- glow:SetKeyValue("rendercolor","255 0 60")
- glow:SetKeyValue("GlowProxySize","2")
- glow:SetKeyValue("HDRColorScale","1")
- glow:SetKeyValue("renderfx","14")
- glow:SetKeyValue("rendermode","3")
- glow:SetKeyValue("renderamt","100")
- glow:SetKeyValue("model","sprites/flare1.spr")
- glow:SetKeyValue("scale","1.2")
- glow:Spawn()
- glow:SetParent(self)
- glow:SetPos(self:GetPos())
- local phys = self:GetPhysicsObject()
- if IsValid(phys) then
- phys:SetMaterial("default_silent")
- phys:Wake()
- phys:SetMass(1)
- phys:EnableDrag(false)
- phys:EnableGravity(false)
- phys:SetBuoyancyRatio(0)
- end
- self.Die = false
- end
- function ENT:SetDamage(dmg)
- self.Damage = dmg
- end
- function ENT:PhysicsCollide(data, physobj)
- local start = data.HitPos + data.HitNormal
- local endpos = data.HitPos - data.HitNormal
- util.Decal("fadingscorch", start, endpos)
- data.HitEntity:TakeDamage(self.Damage, self.Entity:GetOwner())
- self.Die = true
- end
- function ENT:Think()
- if self.Die == true then
- self:Remove()
- end
- end
- function ENT:OnRemove()
- if self.sound then self.sound:Stop() end
- local effectdata = EffectData()
- effectdata:SetOrigin(self.endpos or self:GetPos())
- self:EmitSound("weapons/enfstop.wav")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement