Author Topic: Using Console to Give all of Your Bricks the same Brick Name  (Read 1384 times)

Is it possible? If so, what is the code?

Code: [Select]
function giveAllBricksName(%name)
{
   for(%i=0;%i<missionCleanup.getCount();%i++) //Loop through mission cleanup
   {
      %this = missionCleanup.getObject(%i) //%this is object number %i
      if(%this.getType() $="FxDTSbrick") //If %this is a brick
      {
         %this.setName("_" @ %name); //Give it the name (brick names start with an underscore)
      }
   }
}
This isn't client sided and gives ALL bricks on the server the name you entered.

Now I don't know the function for setting a bricks name, but if I had to guess, I'd say it would be:
%bg = findClientByName("Player's name").brickGroup; for(%i=0;%i<%bg.getCount();%i++){%bg.getObject(%i).setName("brick name");}
Now I'm not sure about that, so don't hold me against it. Ha
« Last Edit: June 11, 2009, 03:19:00 PM by lilboarder32 »

You're both right; lilborder's is for going through all YOUR bricks, and Amade's does what it says it does: goes through ALL bricks on the server.

Also, don't use SetName, as it wont update lists and names properly.
There was another function for that.

I tried lil's, and it gave all of the bricks the same name, but the brick name woun't show up on the event menu.

Edit:
Also, don't use SetName, as it wont update lists and names properly.
There was another function for that.

Then what is the other function?

Let me try, this will be a "/" command
Code: [Select]
function servercmdgiveAllBricksName(%client,%name)
{
   for(%i=0;%i<missionCleanup.getCount();%i++) //Loop through mission cleanup
   {
      %this = missionCleanup.getObject(%i) //%this is object number %i
      if(%this.getType() $="FxDTSbrick") //If %this is a brick
      {
         %owner = MissionCleanup.getGroup(%i).getname();
          if(%owner $= %client.getname())
             {
                  %this.setName("_" @ %name); //Give it the name (brick names start with an underscore)
               }
         }
    }
}
And I just edited Amades a little, why make it a console thing? Why not just make it a script?

That still leaves the problem of not updating the name list properly.

I'm about to find the function, hold on.


Didn't Destiny make an event that did this?

This looks fun. Rename all the bricks in a massive build to "bob" and then make a new brick that when activated, it fake kills bricks named bob (i.e everything!).


Console code is too long to enter :\

Console code is too long to enter :\

Could you at least give me the code? I might be able to write a simple script with it.