mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
EFFECT = {}
|
||||
|
||||
function EFFECT:Init(data)
|
||||
self.Position = data:GetOrigin()
|
||||
self.Emitter = ParticleEmitter(self.Position)
|
||||
self.LifeTime = 2
|
||||
self.EndTime = CurTime() + self.LifeTime
|
||||
|
||||
for i = 1, 50 do
|
||||
local particle = self.Emitter:Add("effects/spark", self.Position)
|
||||
if particle then
|
||||
particle:SetVelocity(VectorRand() * 100)
|
||||
particle:SetLifeTime(0)
|
||||
particle:SetDieTime(math.Rand(0.5, 1.5))
|
||||
particle:SetStartAlpha(255)
|
||||
particle:SetEndAlpha(0)
|
||||
particle:SetStartSize(25)
|
||||
particle:SetEndSize(0)
|
||||
particle:SetRoll(math.Rand(0, 360))
|
||||
particle:SetRollDelta(math.Rand(-2, 2))
|
||||
particle:SetColor(104, 160, 176)
|
||||
particle:SetAirResistance(50)
|
||||
particle:SetGravity(Vector(0, 0, -100))
|
||||
end
|
||||
end
|
||||
|
||||
self.Radius = 200
|
||||
self.Damage = 5
|
||||
self.Owner = data:GetEntity()
|
||||
|
||||
net.Start("ixTeslaDamage")
|
||||
net.WriteVector(self.Position)
|
||||
net.WriteFloat(self.Radius)
|
||||
net.WriteFloat(self.Damage)
|
||||
net.WriteEntity(self.Owner)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
if CurTime() > self.EndTime then
|
||||
self.Emitter:Finish()
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
if LocalPlayer():IsAdmin() and LocalPlayer():GetMoveType() == MOVETYPE_NOCLIP then
|
||||
render.SetColorMaterial()
|
||||
render.DrawSphere(self.Position, self.Radius, 30, 30, Color(255, 165, 0, 100))
|
||||
end
|
||||
end
|
||||
|
||||
effects.Register(EFFECT, "tesla_effect")
|
||||
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
function EFFECT:Init( data )
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
|
||||
effects.Register(EFFECT, "purple_smoke")
|
||||
@@ -0,0 +1,45 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.Base = "base_gmodentity"
|
||||
ENT.PrintName = "Base Crystal"
|
||||
ENT.Author = "Base Crystal"
|
||||
ENT.Spawnable = false
|
||||
ENT.AdminSpawnable = false
|
||||
ENT.crystalColor = Color(255,255,255,255)
|
||||
ENT.isCrystal = true
|
||||
|
||||
if (SERVER) then
|
||||
|
||||
function ENT:Initialize()
|
||||
ix.crystals:OnInitialize(self)
|
||||
end
|
||||
|
||||
function ENT:UpdateTransmitState()
|
||||
return TRANSMIT_ALWAYS;
|
||||
end;
|
||||
|
||||
|
||||
function ENT:OnTakeDamage(damageInfo)
|
||||
ix.crystals:OnTakeDamage(self,damageInfo)
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
ix.crystals:OnRemove(self)
|
||||
end;
|
||||
|
||||
function ENT:Use(activator, caller)
|
||||
ix.crystals:OnUse(self,activator,caller)
|
||||
end
|
||||
|
||||
function ENT:TriggerReaction()
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,189 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
DEFINE_BASECLASS("crystal_base")
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.Base = "crystal_base"
|
||||
ENT.Author = "gb"
|
||||
ENT.PrintName = "Blue Crystal"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
ENT.Category = "Crystals"
|
||||
ENT.LootCrystal = "blue_crystal"
|
||||
ENT.loopSound = "ambient/energy/electric_loop.wav"
|
||||
|
||||
if (SERVER) then
|
||||
function ENT:OnInitialize()
|
||||
self:SetModel("models/props_abandoned/crystals_fixed/crystal_damaged/crystal_cluster_huge_damaged_a.mdl")
|
||||
self:SetSkin(6)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
|
||||
local physicsObject = self:GetPhysicsObject()
|
||||
self:EmitSound(self.loopSound, 60, 100)
|
||||
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:Wake()
|
||||
physicsObject:EnableMotion(false)
|
||||
end
|
||||
|
||||
local StartLight1 = ents.Create("light_dynamic")
|
||||
StartLight1:SetKeyValue("brightness", "3")
|
||||
StartLight1:SetKeyValue("distance", "150")
|
||||
StartLight1:SetKeyValue("style", 5)
|
||||
StartLight1:SetLocalPos(self:GetPos() + self:GetUp() * 30)
|
||||
StartLight1:SetLocalAngles(self:GetAngles())
|
||||
StartLight1:Fire("Color", "0 0 176")
|
||||
StartLight1:SetParent(self)
|
||||
StartLight1:Spawn()
|
||||
StartLight1:Activate()
|
||||
StartLight1:SetParent(self)
|
||||
StartLight1:Fire("TurnOn", "", 0)
|
||||
self:DeleteOnRemove(StartLight1)
|
||||
|
||||
timer.Create("BeamRingEffectTimer" .. self:EntIndex(), 2, 0, function()
|
||||
if not IsValid(self) then return end
|
||||
self:CreateBeamRingEffect()
|
||||
self:CreateTeslaEffect()
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:CreateBeamRingEffect()
|
||||
effects.BeamRingPoint(self:GetPos() + Vector(0, 0, 10), 1, 0, 400, 10, 0, Color(104, 100, 176))
|
||||
end
|
||||
|
||||
function ENT:CreateTeslaEffect()
|
||||
local effectdata = EffectData()
|
||||
effectdata:SetOrigin(self:GetPos() + Vector(0, 0, 10))
|
||||
effectdata:SetEntity(self)
|
||||
util.Effect("tesla_effect", effectdata)
|
||||
|
||||
for i = 1, 10 do
|
||||
local tesla = ents.Create("point_tesla")
|
||||
if not IsValid(tesla) then return end
|
||||
|
||||
tesla:SetPos(self:GetPos() + VectorRand() * 50)
|
||||
tesla:SetKeyValue("m_SoundName", "")
|
||||
tesla:SetKeyValue("texture", "sprites/laserbeam.spr")
|
||||
tesla:SetKeyValue("m_Color", "104 160 176")
|
||||
tesla:SetKeyValue("m_flRadius", "100")
|
||||
tesla:SetKeyValue("beamcount_min", "5")
|
||||
tesla:SetKeyValue("beamcount_max", "8")
|
||||
tesla:SetKeyValue("thick_min", "2")
|
||||
tesla:SetKeyValue("thick_max", "4")
|
||||
tesla:SetKeyValue("lifetime_min", "0.1")
|
||||
tesla:SetKeyValue("lifetime_max", "0.2")
|
||||
tesla:SetKeyValue("interval_min", "0.05")
|
||||
tesla:SetKeyValue("interval_max", "0.1")
|
||||
tesla:Spawn()
|
||||
tesla:Activate()
|
||||
self:EmitSound("ambient/energy/zap"..math.random(1, 9)..".wav")
|
||||
tesla:Fire("DoSpark", "", 0)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:TriggerReaction(damageInfo)
|
||||
local attacker = damageInfo:GetAttacker()
|
||||
if not IsValid(attacker) then return end
|
||||
|
||||
local hitPos = damageInfo:GetDamagePosition()
|
||||
|
||||
self:EmitSound("physics/glass/glass_impact_bullet1.wav")
|
||||
|
||||
local tesla = ents.Create("point_tesla")
|
||||
if not IsValid(tesla) then return end
|
||||
local damageInfo = DamageInfo()
|
||||
|
||||
damageInfo:SetDamage(5)
|
||||
damageInfo:SetDamageType(DMG_SHOCK)
|
||||
damageInfo:SetAttacker(attacker)
|
||||
damageInfo:SetInflictor(attacker)
|
||||
attacker:TakeDamageInfo(damageInfo)
|
||||
|
||||
tesla:SetPos(hitPos)
|
||||
tesla:SetKeyValue("m_SoundName", "")
|
||||
tesla:SetKeyValue("texture", "sprites/laserbeam.spr")
|
||||
tesla:SetKeyValue("m_Color", "104 100 176")
|
||||
tesla:SetKeyValue("m_flRadius", "100")
|
||||
tesla:SetKeyValue("beamcount_min", "5")
|
||||
tesla:SetKeyValue("beamcount_max", "8")
|
||||
tesla:SetKeyValue("thick_min", "2")
|
||||
tesla:SetKeyValue("thick_max", "4")
|
||||
tesla:SetKeyValue("lifetime_min", "0.1")
|
||||
tesla:SetKeyValue("lifetime_max", "0.2")
|
||||
tesla:SetKeyValue("interval_min", "0.05")
|
||||
tesla:SetKeyValue("interval_max", "0.1")
|
||||
tesla:Spawn()
|
||||
tesla:Activate()
|
||||
self:EmitSound("ambient/energy/zap"..math.random(1, 9)..".wav")
|
||||
tesla:Fire("DoSpark", "", 0)
|
||||
|
||||
|
||||
timer.Simple(0.5, function()
|
||||
if IsValid(tesla) then
|
||||
tesla:Remove()
|
||||
end
|
||||
if IsValid(sound) then
|
||||
sound:Remove()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
self:StopSound(self.loopSound)
|
||||
timer.Remove("BeamRingEffectTimer" .. self:EntIndex())
|
||||
end
|
||||
|
||||
function ENT:OnDestroyed(singularity)
|
||||
self:Dissolve(1, 100)
|
||||
|
||||
timer.Simple(2, function()
|
||||
if not IsValid(self) then return end
|
||||
|
||||
self:EmitSound(table.Random({"vj_hlr/fx/bustglass1.wav","vj_hlr/fx/bustglass2.wav"}), 100)
|
||||
util.ScreenShake(self:GetPos(), 100, 150, 5, 1250, true)
|
||||
|
||||
local data = EffectData()
|
||||
data:SetOrigin(self:GetPos())
|
||||
util.Effect("cball_explode", data)
|
||||
|
||||
effects.BeamRingPoint(self:GetPos(), 0.2, 12, 1024, 64, 0, Color(104, 100, 176, 32), {
|
||||
speed = 0,
|
||||
spread = 0,
|
||||
delay = 0,
|
||||
framerate = 2,
|
||||
material = "sprites/lgtning.vmt"
|
||||
})
|
||||
|
||||
effects.BeamRingPoint(self:GetPos(), 0.5, 12, 1024, 64, 0, Color(104, 100, 176, 64), {
|
||||
speed = 0,
|
||||
spread = 0,
|
||||
delay = 0,
|
||||
framerate = 2,
|
||||
material = "sprites/lgtning.vmt"
|
||||
})
|
||||
|
||||
if singularity or ix.config.Get("crystalSingularity", false) then
|
||||
local singularityPos = self:GetPos() + Vector(0, 0, 50)
|
||||
local singularityEnt = ents.Create("wn_singularity_blue")
|
||||
|
||||
if IsValid(singularityEnt) then
|
||||
singularityEnt:SetPos(singularityPos)
|
||||
singularityEnt:Spawn()
|
||||
end
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,129 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
DEFINE_BASECLASS("crystal_base")
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.Base = "crystal_base"
|
||||
ENT.Author = "gb"
|
||||
ENT.PrintName = "Purple Crystal"
|
||||
ENT.Spawnable = false
|
||||
ENT.AdminSpawnable = false
|
||||
ENT.Category = "Crystals"
|
||||
ENT.LootCrystal = "purple_crystal"
|
||||
ENT.loopSound = "npc/attack_helicopter/aheli_wash_loop3.wav"
|
||||
|
||||
if (SERVER) then
|
||||
function ENT:OnInitialize()
|
||||
self:SetModel("models/props_abandoned/crystals_fixed/crystal_damaged/crystal_cluster_huge_damaged_b.mdl")
|
||||
self:SetSkin(7)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
|
||||
local physicsObject = self:GetPhysicsObject()
|
||||
self:EmitSound(self.loopSound, 60, 100)
|
||||
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:Wake()
|
||||
physicsObject:EnableMotion(false)
|
||||
end
|
||||
|
||||
local StartLight1 = ents.Create("light_dynamic")
|
||||
StartLight1:SetKeyValue("brightness", "3")
|
||||
StartLight1:SetKeyValue("distance", "150")
|
||||
StartLight1:SetKeyValue("style", 5)
|
||||
StartLight1:SetLocalPos(self:GetPos() + self:GetUp() * 30)
|
||||
StartLight1:SetLocalAngles(self:GetAngles())
|
||||
StartLight1:Fire("Color", "0 0 176")
|
||||
StartLight1:SetParent(self)
|
||||
StartLight1:Spawn()
|
||||
StartLight1:Activate()
|
||||
StartLight1:SetParent(self)
|
||||
StartLight1:Fire("TurnOn", "", 0)
|
||||
self:DeleteOnRemove(StartLight1)
|
||||
|
||||
timer.Create("BeamRingEffectTimer" .. self:EntIndex(), 2, 0, function()
|
||||
if not IsValid(self) then return end
|
||||
self:CreateSmokeEffect()
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:CreateSmokeEffect()
|
||||
local effectdata = EffectData()
|
||||
effectdata:SetOrigin(self:GetPos() + Vector(0, 0, 10))
|
||||
effectdata:SetEntity(self)
|
||||
util.Effect("purple_smoke", effectdata)
|
||||
end
|
||||
|
||||
function ENT:TriggerReaction(damageInfo)
|
||||
local attacker = damageInfo:GetAttacker()
|
||||
if not IsValid(attacker) then return end
|
||||
|
||||
local hitPos = damageInfo:GetDamagePosition()
|
||||
|
||||
self:EmitSound("physics/glass/glass_impact_bullet1.wav")
|
||||
|
||||
local tesla = ents.Create("point_tesla")
|
||||
if not IsValid(tesla) then return end
|
||||
local damageInfo = DamageInfo()
|
||||
|
||||
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
self:StopSound(self.loopSound)
|
||||
timer.Remove("BeamRingEffectTimer" .. self:EntIndex())
|
||||
end
|
||||
|
||||
function ENT:OnDestroyed(singularity)
|
||||
self:Dissolve(1, 100)
|
||||
|
||||
timer.Simple(2, function()
|
||||
if not IsValid(self) then return end
|
||||
|
||||
self:EmitSound(table.Random({"vj_hlr/fx/bustglass1.wav","vj_hlr/fx/bustglass2.wav"}), 100)
|
||||
util.ScreenShake(self:GetPos(), 100, 150, 5, 1250, true)
|
||||
|
||||
local data = EffectData()
|
||||
data:SetOrigin(self:GetPos())
|
||||
util.Effect("cball_explode", data)
|
||||
|
||||
effects.BeamRingPoint(self:GetPos(), 0.2, 12, 1024, 64, 0, Color(104, 100, 176, 32), {
|
||||
speed = 0,
|
||||
spread = 0,
|
||||
delay = 0,
|
||||
framerate = 2,
|
||||
material = "sprites/lgtning.vmt"
|
||||
})
|
||||
|
||||
effects.BeamRingPoint(self:GetPos(), 0.5, 12, 1024, 64, 0, Color(104, 100, 176, 64), {
|
||||
speed = 0,
|
||||
spread = 0,
|
||||
delay = 0,
|
||||
framerate = 2,
|
||||
material = "sprites/lgtning.vmt"
|
||||
})
|
||||
|
||||
if singularity or ix.config.Get("crystalSingularity", false) then
|
||||
local singularityPos = self:GetPos() + Vector(0, 0, 50)
|
||||
local singularityEnt = ents.Create("wn_singularity_blue")
|
||||
|
||||
if IsValid(singularityEnt) then
|
||||
singularityEnt:SetPos(singularityPos)
|
||||
singularityEnt:Spawn()
|
||||
end
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
end)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,110 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.Base = "base_gmodentity"
|
||||
ENT.Author = "gb"
|
||||
ENT.PrintName = "Blue Singularity"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
ENT.Category = "Crystals"
|
||||
ENT.LootCrystal = "blue_crystal"
|
||||
ENT.loopSound = "ambient/energy/force_field_loop1.wav"
|
||||
|
||||
if (SERVER) then
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/hunter/blocks/cube025x025x025.mdl")
|
||||
self:SetNoDraw(true)
|
||||
self:DrawShadow(false)
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
ParticleEffectAttach("[8]magic_portal", 1, self, 1)
|
||||
self:EmitSound(self.loopSound)
|
||||
|
||||
local physicsObject = self:GetPhysicsObject()
|
||||
if (IsValid(physicsObject)) then
|
||||
physicsObject:Wake()
|
||||
physicsObject:EnableMotion(false)
|
||||
end
|
||||
|
||||
local StartLight1 = ents.Create("light_dynamic")
|
||||
StartLight1:SetKeyValue("brightness", "5")
|
||||
StartLight1:SetKeyValue("distance", "150")
|
||||
StartLight1:SetKeyValue("style", 5)
|
||||
StartLight1:SetLocalPos(self:GetPos() + self:GetUp() * 30)
|
||||
StartLight1:SetLocalAngles(self:GetAngles())
|
||||
StartLight1:Fire("Color", "0 0 176")
|
||||
StartLight1:SetParent(self)
|
||||
StartLight1:Spawn()
|
||||
StartLight1:Activate()
|
||||
StartLight1:SetParent(self)
|
||||
StartLight1:Fire("TurnOn", "", 0)
|
||||
self:DeleteOnRemove(StartLight1)
|
||||
|
||||
timer.Create("BeamRingEffectTimer" .. self:EntIndex(), 1, 0, function()
|
||||
if not IsValid(self) then return end
|
||||
self:CreateBeamRingEffect()
|
||||
self:CreateTeslaEffect()
|
||||
end)
|
||||
|
||||
timer.Create("RemoveEntityTimer" .. self:EntIndex(), 120, 1, function()
|
||||
if IsValid(self) then
|
||||
self:Dissolve(1, 300)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:CreateBeamRingEffect()
|
||||
effects.BeamRingPoint(self:GetPos() + Vector(0, 0, 10), 1, 0, 400, 10, 0, Color(104, 100, 176))
|
||||
end
|
||||
|
||||
function ENT:CreateTeslaEffect()
|
||||
local effectdata = EffectData()
|
||||
effectdata:SetOrigin(self:GetPos() + Vector(0, 0, 10))
|
||||
effectdata:SetEntity(self)
|
||||
util.Effect("tesla_effect", effectdata)
|
||||
|
||||
for i = 1, 5 do
|
||||
local tesla = ents.Create("point_tesla")
|
||||
if not IsValid(tesla) then return end
|
||||
|
||||
tesla:SetPos(self:GetPos() + VectorRand() * 50)
|
||||
tesla:SetKeyValue("m_SoundName", "")
|
||||
tesla:SetKeyValue("texture", "sprites/laserbeam.spr")
|
||||
tesla:SetKeyValue("m_Color", "104 160 176")
|
||||
tesla:SetKeyValue("m_flRadius", "100")
|
||||
tesla:SetKeyValue("beamcount_min", "5")
|
||||
tesla:SetKeyValue("beamcount_max", "8")
|
||||
tesla:SetKeyValue("thick_min", "2")
|
||||
tesla:SetKeyValue("thick_max", "4")
|
||||
tesla:SetKeyValue("lifetime_min", "0.1")
|
||||
tesla:SetKeyValue("lifetime_max", "0.2")
|
||||
tesla:SetKeyValue("interval_min", "0.05")
|
||||
tesla:SetKeyValue("interval_max", "0.1")
|
||||
tesla:Spawn()
|
||||
tesla:Activate()
|
||||
self:EmitSound("ambient/energy/zap"..math.random(1, 9)..".wav")
|
||||
tesla:Fire("DoSpark", "", 0)
|
||||
|
||||
timer.Simple(0.2, function()
|
||||
if IsValid(tesla) then
|
||||
tesla:Remove()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
timer.Remove("BeamRingEffectTimer" .. self:EntIndex())
|
||||
timer.Remove("RemoveEntityTimer" .. self:EntIndex())
|
||||
self:StopSound(self.loopSound)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user