aboutsummaryrefslogtreecommitdiff
path: root/entities/entities/ws_teleporter/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'entities/entities/ws_teleporter/init.lua')
-rw-r--r--entities/entities/ws_teleporter/init.lua36
1 files changed, 31 insertions, 5 deletions
diff --git a/entities/entities/ws_teleporter/init.lua b/entities/entities/ws_teleporter/init.lua
index f364cac..eee04d7 100644
--- a/entities/entities/ws_teleporter/init.lua
+++ b/entities/entities/ws_teleporter/init.lua
@@ -4,14 +4,40 @@ AddCSLuaFile("shared.lua")
include('shared.lua')
function ENT:Initialize()
+ self:SetModel("models/hunter/tubes/circle2x2.mdl")
+
self:PhysicsInit(SOLID_VPHYSICS)
- self:SetMoveType(MOVETYPE_NONE)
+ self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
- self:DrawShadow(false)
+ -- self:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE)
+ self:PhysWake()
+ self:SetMaterial("models/shadertest/shader3")
- local phys = self:GetPhysicsObject()
- phys:EnableMotion(false)
- phys:Sleep()
+ timer.Simple(0,function()
+ local phys = self:GetPhysicsObject()
+ if IsValid(phys) then
+ phys:EnableMotion(false)
+ else
+ print("Failed to disable motion")
+ end
+ end)
+
+ timer.Simple(20,function()
+ local exp = ents.Create("env_explosion")
+ exp:SetPos(self:GetPos())
+ exp:Fire("Explode","",0)
+ exp:Spawn()
+ for k,v in pairs(ents.FindInSphere(self:GetPos(),200)) do
+ if v.TakeDamage then
+ local dmg = (200 - v:GetPos():Distance(self:GetPos())) / 2
+ v:TakeDamage(dmg,nil,self)
+ end
+ end
+
+ self.Remove(self)
+ end)
+
+ --phys:Sleep()
self:SetHealth(30)