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

and are you implying that i am not experienced?
No, that's not what I meant

-legitimate point- ...and getRotation

Completely ruined the argument for me.

another big error that it looks like people are missing:

when you move over to the camb() function for whatever reason, you do not send the %client data along with it, so %client has no meaning in that entire function.

whats the difference between
%client.name
and

function gameConnection::getPlayerName(%client)
{
    return %client.name;
}


or
%obj.rotation
and
function simobject::getRotation(%this)
{
    return %this.rotation;
}

or
%obj.position
and
function simobject::getPosition(%this)
{
    return %this.position;
}


There is no difference, don't argue about it.

Completely ruined the argument for me.
I always forget getRotation isn't a default function; I never understood why

whats the difference between
For Badspot to add a getPlayerName function and call it the "preferred method" method, there must be some difference.
Whatever that difference is, I'm sure it's the same as position/getPosition()

None of my recent add-on downloads have shown up in the add-on list in blockland. Maybe I have too much, so I am probably going to delete some unnecessary add-ons. It's probably not the problem, but it's worth a shot.

There is no add-on limit (that I'm aware of), only a datablock limit, and the datablocks aren't created until execution.
So if the add-on isn't showing up, either you're missing a file, it's packaged incorrectly, or it's not in the add-ons folder.
You are putting it in the add-ons folder in my documents, right?

You are putting it in the add-ons folder in my documents, right?

What.

I'm putting them in Computer/C:/Blockland/Add-Ons/

Blockland has been moved to My Documents since v20. The folder you're putting your add-ons in is the old installation of v19.
Unless you used -profilepath on the launcher properties to move it there, then disregard this post and my previous post.

That's why my recent Add-Ons weren't working.

It's now in my Add-Ons folder. Thank you so loving much. However, the command doesn't work.

It's gone.

It's Back.
« Last Edit: September 17, 2012, 10:56:20 PM by Miner Blockman »

My script is still broken, however, there are no synax errors. When I say /clearMusicBricks or type the exec(); command with my script in there, it does not work. This is my script:

Code: [Select]
function servercmdClearMusicBricks()
{
if(!%client.isAdmin)     
        continue;

if($Server::BrickCount > 0)
{
messageAll('MsgClearBricks', "\c3" @ %client.getPlayerName() @ "\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)
return;

%brick.delete();
}
}
}
}


Don't use continue outside of a loop lol.

My script is still broken, however, there are no synax errors. When I say /clearMusicBricks or type the exec(); command with my script in there, it does not work. This is my script:

Code: [Select]
function servercmdClearMusicBricks()
{
if(!%client.isAdmin)     
        continue;

if($Server::BrickCount > 0)
{
messageAll('MsgClearBricks', "\c3" @ %client.getPlayerName() @ "\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)
return;

%brick.delete();
}
}
}
}
Lets see what we can do here...

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")
return;
if(!%brick.isPlanted)
return;
if(%brick.isDead)
return;

%brick.delete();
}
}
}
}

Try this.

jes why did you replace ALL of his continues with returns? That'll just break it even more.

The continues inside of the for loop were fine.