Blockland Forums > Help

Scripting Help

<< < (2/3) > >>

phflack:
does it show up in a trace?
i do remember the ghost brick is part of their brickgroup, in case there's no function to prevent it directly

jes00:
You should still make the changes I recommended. There's currently a console error when a non-admin plants a brick.

I'd either use BrickDeployProjectile::onCollision or fxDTSBrick::onAdd and check if isPlanted is false.

Medieval:
One last thing before I am done, I have finished this and ghost bricks do not place anymore.
But even as admin I cannot place them.
I am wondering what I have to put in the code to keep the ghost brick as admin or with permission.

--- Code: ---function fxDTSBrick::onAdd(%brick, %client, %obj)
{
%c = getBrickGroupFromObject(%brick).client;
if(isObject(%c) && isObject(%c.player) && isObject(%c.player.tempbrick))
{
if(%c.isAdmin)
{
// Here
return;
}
else if(%c.buildallow == 1)
{
// Here
return;
}
else
{
commandToClient(%c,'centerprint',"\c7Building is not enabled for players.",2);
%brick.schedule(0,"delete");
%c.player.tempbrick.delete();
}
}
}
--- End code ---

(In the // Here part)

The Brighter Dark:
parent the normal function where you want to be able to build normally

Medieval:
Thank you!
I have finished the addon.
Lots of love!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version