aboutsummaryrefslogtreecommitdiff
path: root/entities
diff options
context:
space:
mode:
Diffstat (limited to 'entities')
-rw-r--r--entities/entities/ws_teleporter/init.lua36
-rw-r--r--entities/entities/ws_teleporter/shared.lua3
2 files changed, 32 insertions, 7 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)
diff --git a/entities/entities/ws_teleporter/shared.lua b/entities/entities/ws_teleporter/shared.lua
index 3899060..0d902fb 100644
--- a/entities/entities/ws_teleporter/shared.lua
+++ b/entities/entities/ws_teleporter/shared.lua
@@ -3,7 +3,7 @@ ENT.Base = "base_anim"
function ENT:OnRemove()
end
---[[
+
function ENT:PhysicsCollide(data, phys)
print("We're collideing!")
if(self.endpoint) then
@@ -17,4 +17,3 @@ function ENT:PhysicsCollide(data, phys)
print("Teleporter without endpoint, this might be an error!")
end
end
-]]--