Blockland Forums > Modification Help
Spawning a brick directly above another
Space Man:
How would I spawn a brick directly above another spawned brick via script?
I know how to spawn a brick and change its position in all axes but is there a good way to spawn a brick on top of another, other than
changing its z axis.
otto-san:
--- Quote from: Space Man on October 07, 2011, 11:45:42 AM ---but is there a good way to spawn a brick on top of another, other than changing its z axis.
--- End quote ---
no i dont believe so
Space Man:
--- Quote from: otto-san on October 07, 2011, 03:09:44 PM ---no i dont believe so
--- End quote ---
oh
Amade:
--- Code: ---function fxDTSbrick::UpDuplicate(%this)
{
%zsize = %this.getDatablock().brickSizeZ * 0.2;
%pos = vectorAdd(%this.getPosition(), "0 0 " @ %zsize);
%brick = new FxDTSbrick()
{
datablock = %this.getDatablock();
position = %pos;
rotation = %this.rotation;
colorID = %this.colorID;
scale = "1 1 1";
angleID = %this.angleID;
colorFxID = %this.colorFxID;
shapeFxID = %this.shapeFxID;
isPlanted = 1;
client = %this.client;
};
%brick.plant();
%brick.setTrusted(1);
if(isObject(%this.getGroup()))
{
%this.getGroup().add(%brick);
}
$Server::BrickCount++;
return %brick;
}
--- End code ---
otto-san:
Shouldn't you set the brick to trusted before planting it or does it not make a difference?