Author Topic: vehicles blow up in water  (Read 1743 times)

whats that script that makes vehicles blow up in water after like 10 secs, i don't remember the name so i cant find it

Code: [Select]
function VehicleData::onEnterLiquid(%data, %obj, %coverage, %type)
{
   Parent::onEnterLiquid(%data, %obj, %coverage, %type);
   %obj.damage(%obj, %obj.getPosition(), 10000, $DamageType::Lava);
   %obj.finalExplosion();
}
And for players
Code: [Select]
function Armor::onEnterLiquid(%data, %obj, %coverage, %type)
{
   Parent::onEnterLiquid(%data, %obj, %coverage, %type);
   %obj.hasShotOnce = true;
   %obj.invulnerable = false;
   %obj.damage(%obj, %obj.getPosition(), 10000, $DamageType::Lava);
}

Code: [Select]
function VehicleData::onEnterLiquid(%data, %obj, %coverage, %type)
{
   Parent::onEnterLiquid(%data, %obj, %coverage, %type);
   %obj.damage(%obj, %obj.getPosition(), 10000, $DamageType::Lava);
   %obj.finalExplosion();
}
And for players
Code: [Select]
function Armor::onEnterLiquid(%data, %obj, %coverage, %type)
{
   Parent::onEnterLiquid(%data, %obj, %coverage, %type);
   %obj.hasShotOnce = true;
   %obj.invulnerable = false;
   %obj.damage(%obj, %obj.getPosition(), 10000, $DamageType::Lava);
}
He might not want them to blow up if they leave the water before the ten seconds are up.

Code from the 32x32 Zone Brick
Code: [Select]
datablock fxDTSBrickData (brickzone32x32 : brick32xCubeData)
{
   category = "ZoneBricks";
   subCategory = "Basic";
   uiName = "32x32 Zone Cube";
   alwaysShowWireFrame = false;
   isWaterBrick = true;
};
Since this is considered a water brick, wouldnt that mean that once a vehicle enters it, it would call your script,and the vehicle would explode?


Since this is considered a water brick, wouldnt that mean that once a vehicle enters it, it would call your script,and the vehicle would explode?
I think he means the environment water, not the brick. Or maybe he wants both idk

I think he means the environment water, not the brick. Or maybe he wants both idk
ohh ok, that would make sense if onEnterLiquid was only for environment water

ohh ok, that would make sense if onEnterLiquid was only for environment water
might be, not sure though. somehow misread that I thought if you were asking if it only worked with env. water

Anyway yeah
« Last Edit: July 14, 2014, 11:47:03 AM by gr8dayseth »

ohh ok, that would make sense if onEnterLiquid was only for environment water
onEnterLiquid is called when it enters into a water zone. The isWaterBrick attribute only allows you to place bricks inside of it and vice versa. When an actual water brick is created, it makes a physical zone object, which is the water. Water bricks aren't actually technically water. Water is simply created inside of the brick when it's planted.

only env water, alot of my build use zonebricks so that would be a problem lol


Thanks, that's exactly what I was looking for. Just could not remember the name