Author Topic: What's wrong with my script?  (Read 3378 times)

jes why did you replace ALL of his continues with returns? That'll just break it even more.
Lol, got carried away.
Code: [Select]
function serverCmdClearMusicBricks(%client)
{
if(!%client.isAdmin)    
         return;

if($Server::BrickCount > 0)
{
messageAll('MsgClearBricks', "\c3" @ %client.name @ "\c0 cleared music bricks.");

   %groupCount = MainBrickGroup.getCount();

   for(%i = 0; %i < %groupCount; %i++)
   {
%group = MainBrickGroup.getObject(%i);
%count = %group.getCount();

for(%j = 0; %j < %count; %j++)
{
%brick = %group.getObject(%j);

if(%brick.getDatablock().getName() !$= "brickMusicData")
continue;
if(%brick.isPlanted)
continue;
if(!%brick.isDead)
continue;

%brick.delete();
}
}
}
}

Lol, got carried away.
Code: [Select]

if(!%brick.isDead)
continue;


Doesn't this check if it's dead? We don't want it to clear the dead bricks...

It's saying if it's not dead, continue

It's saying if it's not dead, continue

We dont need to worry about dead bricks. It should be if(%brick.isDead)continue;

We dont need to worry about dead bricks. It should be if(%brick.isDead)continue;
Wait then would it not only check for dead music bricks?

He's right, actually. That reads "if the brick is alive, skip this brick."

Lol, got carried away.
Code: [Select]
function serverCmdClearMusicBricks(%client)
{

What is the function for this? /clearMusicBricks or /clearMusicBricks playername?

What is the function for this? /clearMusicBricks or /clearMusicBricks playername?
/clearMusicBricks

What is the function for this? /clearMusicBricks or /clearMusicBricks playername?
/ClearMusicBricks playername would be
Code: [Select]
function serverCmdClearMusicBricks(%client, %playername){}the first argument with these servercmd's is the object(read:client) calling them.
Is your script working with the... modified version(read: fixed version) of Jes00's code for it?

Is MainBrickGroup a thing? I've never seen anyone use it.
 EDIT: umm... MainBrickGroup.getCount returns 3... always? Probably just me being stupid, but it's not my problem in the first place.
« Last Edit: September 25, 2012, 04:58:10 PM by wizzlemanizzle »

Is MainBrickGroup a thing? I've never seen anyone use it.
 EDIT: umm... MainBrickGroup.getCount returns 3... always? Probably just me being stupid, but it's not my problem in the first place.

Should've asked me, silly.

The MainBrickgroup is where the client-based brickgroups live. The reason you always see only three is probably because there's yours, the brickgroup for 888888 (public brickgroup), and the brickgroup for 999999 (....dunno).

Should've asked me, silly.

The MainBrickgroup is where the client-based brickgroups live. The reason you always see only three is probably because there's yours, the brickgroup for 888888 (public brickgroup), and the brickgroup for 999999 (....dunno).
I'm pretty sure 999999 is the single player brickgroup

I'm pretty sure 999999 is the single player brickgroup


It appears on public Internet servers too.

Badspot himself advises to use getPlayerName() instead of name:and I'm sure others of more experience would also advise the same for getPosition and getRotation
getPlayerName doesn't work with bots since you can't package it.

what is the tagged string 'msgclearbricks' for? why cant that be blank instead? basically... i'm not too sure what tagged strings are and what they're for

The 'MsgClearBricks' tag will create the cleared bricks sound for all the clients