Crank prop

This is supposed to be a start of a prop that’s supposed to give the effects of a stopped heart from the movie Crank
I tried using the the powerthirst and a line from the ironman swep to give the effects of decreasing of health but I can’t figure out how to make it not decrease while your moving and increase when something happens like being hit a number amount of times or running at a certain amount of speed
I admit I’m terrible with this

AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )
include( ‘shared.lua’ )

function ENT:SpawnFunction( ply, tr )
if ( !tr.Hit ) then return end
local SpawnPos = tr.HitPos+Vector(0,0,0)
local ent = ents.Create( “sent_powerthirst” )
ent:SetPos( SpawnPos )
ent:Spawn()
ent:Activate()
ent.Owner=ply
return ent
end

function ENT:Initialize()

local selfent = self.Entity

self.Entity:SetModel("models/Powerthirst/powerthirst.mdl")
self.Entity:PhysicsInit( SOLID_VPHYSICS )
self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
self.Entity:SetSolid( SOLID_VPHYSICS )

local phys = self.Entity:GetPhysicsObject()
if (phys:IsValid()) then
	phys:Wake()
end	

end

function ENT:Use( activator, caller )
self.Entity:Remove()
activator:EmitSound(Sound(“Argh.mp3”),100,100)
Energy=true
activator:PrintMessage( HUD_PRINTCENTER, “Your heart stopped Keep moving to stay alive!!!” )
if ( activator:IsPlayer() ) then
jumppower = activator:GetJumpPower( )
local health = activator:Health()
self.timehp = CurTime() + 0.2
activator:SetHealth( health + 100 )
activator:addhp = -2
activator:timehp = 0
activator:SetJumpPower( 500 )
GAMEMODE:SetPlayerSpeed(activator, 500, 500)
end
end

function playerDies( player, weapon, killer )
player:SetJumpPower( jumppower )
end
hook.Add( “PlayerDeath”, “playerDeathTest”, playerDies );

Ehh. A prop is a model.
Also, go to the LUA section.