----------------------------------------------------------- -- Called when object is added to world -------------------------------------------------------------- -------------------------------------------------------------- -- Called when object is smashed -------------------------------------------------------------- function onDie( self, msg ) ShowBroken( self, msg.attacker ) end -------------------------------------------------------------- -- spawn in the model of the hydrant all broken -------------------------------------------------------------- function ShowBroken( self, playerID ) -- get the hydrant's position local myPos = self:GetPosition{}.pos local hydrant = tostring(self:GetVar("hydrant")) print(" hydrant number "..hydrant) local config = { { "hydrant" , hydrant }} RESMGR:LoadObject { objectTemplate = 7328, x = myPos.x, y = myPos.y, z = myPos.z, owner = self, configData = config } end