local localskillID = 5 function onStartup(self) self:SetVar("bIsDead", false) end function onCollisionPhantom(self, msg) if ( self:GetVar("bIsDead") == true ) then return end local target = msg.objectID local faction = target:GetFaction() -- If a player collided with me, then cast the skill on him if faction and (faction.faction == 1 or faction.faction == 101) then if ( (target:GetHealth().health) < (target:GetMaxHealth().health) ) then self:PlayFXEffect{effectType = "pickup"} self:CastSkill{skillID = localskillID, optionalTargetID = target} self:Die{ killerID = msg.playerID, killType = "SILENT" } self:SetVar("bIsDead", true) end end end