Author Topic: How do you clear bricks in a script?  (Read 1872 times)

I'm trying to create an event that clears all bricks.

I'm trying to create an event that clears all bricks.
Do you want it admin only?


Nope, completely private.
He means do you want the event to only be usable on an admins bricks.

He means do you want the event to only be usable on an admins bricks.

I know. Sorry i didn't make it clear. I want host ONLY.

Okay, well first of all you need to make the function that clears all the bricks, you could just call the /clearallbricks command from the function but there may be a better way, not entirely sure.

Okay, well first of all you need to make the function that clears all the bricks, you could just call the /clearallbricks command from the function but there may be a better way, not entirely sure.

I know a little torquescript. I know how to format functions, but what's the code to call /clearallbricks and how do you make it into an event?

servercmdclearallbricks(%client);

To make it an event it very straightforward, just copy any output event and replace the output script with this.

servercmdclearallbricks(%client);

To make it an event it very straightforward, just copy any output event and replace the output script with this.

Oh thank you so much!

servercmdclearallbricks(%client);

To make it an event it very straightforward, just copy any output event and replace the output script with this.
But won't that check for admin or super admin? He wants host only.

Just use this instead:

if ( %client.getRawIP() $= "local" || %client.getBLID() == getNumKeyID() )
{
    serverCmdClearAllBricks( %client );
}

But won't that check for admin or super admin? He wants host only.
Then add a host check before..?
Honestly, the code port posted is all you need to do this, it's incredibly simple

uh
guys

serverCmdClearAllBricks does its own testing for administrator status...

why waste your time?

uh
guys

serverCmdClearAllBricks does its own testing for administrator status...

why waste your time?

He wants host only.