Author Topic: How do I make respawn bricks?  (Read 965 times)

What is the code to respawn bricks once it Fakekilled?

                  %obj.fakekillbrick();

How do I make a code for respawns?

%brick.fakeKillBrick(3-vector direction, int time);
%brick.respawn(); - Use if you want to respawn a brick earlier than the time it was killed for

For instance, %brick.fakeKillBrick("0 0 10",5); will cause a brick to explode as if hit by a hammer (moving slightly upwards) for five seconds and %brick.fakeKillBrick("0 0 0",0); will cause a brick to fall downwards and disappear permanently until respawned.

What you may want to do is have the direction as some multiple of the brick damage the projectile does and the vector from the projectile to the brick's centre, that way rocket explosions will cause builds to explode outwards rather than just falling down.

%brick.fakeKillBrick(3-vector direction, int time);
%brick.respawn(); - Use if you want to respawn a brick earlier than the time it was killed for

For instance, %brick.fakeKillBrick("0 0 10",5); will cause a brick to explode as if hit by a hammer (moving slightly upwards) for five seconds and %brick.fakeKillBrick("0 0 0",0); will cause a brick to fall downwards and disappear permanently until respawned.

What you may want to do is have the direction as some multiple of the brick damage the projectile does and the vector from the projectile to the brick's centre, that way rocket explosions will cause builds to explode outwards rather than just falling down.

So...

                  %col.hits=0;
                  %obj.client.quantity["AddedOre"] += 1;
                  %brick.fakeKillBrick("0 0 10",5);
                  %brick.respawn();
?

Haha, another digging mod. That makes like 5 now.

Why does everyone want to dig virtual mud all day? Come for Scotland and you can do it for real! With real dosh! :cookieMonster:

XxRJxX:
Which object is %col and which object is %brick? You need to have the value set for both or it might not work. Use %brick.fakeKillBrick("0 0 10",5) (assuming %brick is the actual brick you hit, you must set this) to have the brick respawn automatically after five seconds. If this is going to be in a minigame, set this to the minigame's brick respawn timer.

To force-respawn a brick (e.g. one that has been permanently destroyed), use %brick.respawn(); - otherwise, you don't need to do anything and the time variable should work anyway.

Haha, another digging mod. That makes like 5 now.
0_0 Oh god not again..