Author Topic: Setting a Brick's Owner  (Read 939 times)

I tried changing the stackBL_ID value and the client value both but it didn't work. Either setting the brick's owner, forcing trust to someone (not an invitation), or somehow adding some player to a brick's allowed builders list if it's... possible.

What will you be using this for exactly?

Add-ons that allow admins to build on non-trusted users bricks or force-trust with users will be failed.

Add-ons that allow admins to build on non-trusted users bricks or force-trust with users will be failed.

...

Thanks for the feedback on an add-on that hasn't been made or never will. I'm going to use it to make a Real Estate event for the cashmod. That won't be abuse when you sell your house/office/whatever and they purchase it and they get the rights to build on that one plate, or would it?

Check duplicator code for getting all the bricks in a stack.
Make it so it needs a named brick, and go like:

Code: [Select]
getBrickgroupFromObject(_baseplatelol).remove(obj);
I suggest doing it in a for() loop until all the selected bricks are updated by doing:

Code: [Select]
%client.brickgroup.add(obj);
Which adds it to their brick group. Might be sorta laggy but it should work.

Check duplicator code for getting all the bricks in a stack.
Make it so it needs a named brick, and go like:

Code: [Select]
getBrickgroupFromObject(_baseplatelol).remove(obj);
I suggest doing it in a for() loop until all the selected bricks are updated by doing:

Code: [Select]
%client.brickgroup.add(obj);
Which adds it to their brick group. Might be sorta laggy but it should work.

The brick names don't have any quotes? I need quotes in order to work with this...

What he means by obj is the object reference.
It could be a local variable ( % )
It could be a global variable ( $ )
It could be a name ( string )
It could be an ID ( integer )

As a scripter, you should know this already.

The brick names don't have any quotes? I need quotes in order to work with this...
No, brick names do not have quotes. Why the hell would you need quotes?

I think that changing the ownership could work like this
Code: [Select]
%bl_id=getWord(%argl,0)*1;

%bg="brickgroup_"@%bl_id;

if(!isObject(%bg))
{
new SimGroup(%bg)
{
bl_id=%bl_id;
};mainbrickgroup.add(%bg);
}

%b.getGroup().remove(%b);
%bg.add(%b);

I would do:
Code: [Select]
function allowBuild(%client, %brick)
{
%origin = getBrickgroupFromObject(%brick);
%origin.remove(%brick);
%client.brickGroup.add(%brick);
//PlaceBrickStuff (I can't fill this in figuring you haven't provided how yours works)
%client.brickGroup.remove(%brick);
%origin.add(%brick);
}
That way it returns it to it's rightful owner after the admin's brick is placed.

In fact, just download the Selector Wand and learn from it:
http://www.yayfun.comze.com/SMF/index.php?topic=20.0

They're SimGroups, you don't need to remove it from the original. Adding it to another SimGroup automatically removes it from all others.

You'd only need to do that if it was a SimSet. (identical to groups but objects can be in more than one)

They're SimGroups, you don't need to remove it from the original. Adding it to another SimGroup automatically removes it from all others.

You'd only need to do that if it was a SimSet. (identical to groups but objects can be in more than one)
Never knew that. Thanks.

They're SimGroups, you don't need to remove it from the original. Adding it to another SimGroup automatically removes it from all others.

You'd only need to do that if it was a SimSet. (identical to groups but objects can be in more than one)
Oh, so that's why I crashed when I added my client to another group. Never knew that.

Well, now I need to find out how to get all the bricks in a stack and adding them to a brick group.