Author Topic: Help with Script - Variable related.  (Read 392 times)

So... This is the deal:

I want to make a script. Which contains: (I'ma use something blockland related here lol!)

Onprojectile hit... the brick disappears and the player gets a variable. Like a mining brick. And also if you could be so kind... Tell me how to add health to it. If you were nice.. :3 you will help.

|3  :cookie: are up for grabs if help :)|

Being more specific... I want to use 2 x 2 brick.

In other words, you learn to use VCE in-game.

These are complicated systems.

Here's an excerpt from a script that gives bricks variable health values.

Code: [Select]
package EXT_brickdie
{
function ProjectileData::onCollision(%this,%obj,%col,%fade,%pos,%normal){
//echo("colloded");
if(%col.getclassname()$="FxDTSBrick"&&!$EXT_VAR["Fort_isbuild"]&&$EXT["FORTWARS"]){
if(!%col.brickhp){
%col.brickhp=%col.getdatablock().getvolume()*$EXT_VAR["Fort_brickhp"];
}
%max=%col.getdatablock().getvolume()*$EXT_VAR["Fort_brickhp"];
echo("T" @ %col.brickhp @ %this.directdamage*8);
%col.brickhp-=%this.directdamage*8;
echo(%col.brickhp SPC %max*0.50);
if(%col.brickhp <= %max*0.50){// if its less that 50% alive
%col.setcolorfx(5);
}else{
%col.setcolorfx(0);
}
if(%col.brickhp<=0){
if(!$EXT_VAR["Fort_brickdelete"]){
%col.killbrick();
}else{
%col.delete();
}
}
}
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}

};
activatepackage(EXT_brickdie);