----------------------------------------------------------- --smashables for racing ----------------------------------------------------------- function onStartup(self) self:SetVar("bIsDead", false) end function onCollisionPhantom(self, msg) if ( self:GetVar("bIsDead") == true ) then return end --print("I'm dead!") local target = msg.objectID local faction = target:GetFaction() local isfaction = msg.senderID:GetFaction().faction if isfaction == 113 then target:RacingPlayerClientEvent{ clientEventType="SMASHED_SOMETHING", playerID=target, objectID=self } local speed = target:GetCurrentSpeed{}.fSpeed --print("the speed was :" .. speed) self:Die{ killerID = target, directionRelative_Force = speed * 1.3 } self:SetVar("bIsDead", true) end end