Author Topic: How would I put code in a brick?  (Read 595 times)

For example, I want to put a script into a brick, so where if the "money" variable in the player's client is 10, he will be teleported somewhere. I'm taking a break from VCE, trying to make scripts.

Well, that's not exactly how scripts work. I mean, you can register events and such, like you could do the following:

Code: [Select]
function fxDTSBrick::checkMoney(%brick, %client)
{
if(%client.money >= 10) //i assume you mean if he has at least 10 money
%client.player.setTransform(%brick.getPosition());
}
registerOutputEvent("FXDtsBrick","CheckMoney","",1);

Then, on a brick, you can do something like

onActivate -> Named Brick (Destination) -> CheckMoney

and if they have enough money, they'll be telepoted to the "Destination" brick.