Author Topic: Trigger with brick argument  (Read 1397 times)

http://forum.blockland.us/index.php?topic=102961.0

Solved!

I'm pretty new to triggers and I'm not sure how I would do this, but I have a onEnterTrigger function that requires %brick.
Code: [Select]
function zoneTrigger::onEnterTrigger(%this,%trigger,%obj)
{
if(%trigger.Active == 1)
{
if(%obj.getClassName() $= "Player") {
if(%brick.isTeamed_1 && %obj.client.tdmteam == 1)
{
commandToClient(%obj.client,'ShowWBuyHUD');
%obj.CanWeaponBuy = 1; }
if(%brick.isTeamed_2 && %obj.client.tdmteam == 2)
{
commandToClient(%obj.client,'ShowWBuyHUD');
%obj.CanWeaponBuy = 1; }
if(%brick.isAll_1)
{
commandToClient(%obj.client,'ShowWBuyHUD');
%obj.CanWeaponBuy = 1; }
}
}
}
How would I get %brick to actually be the brick that this trigger is located on?
« Last Edit: March 13, 2010, 06:44:17 PM by HellsHero »

Make so when the zone is created, that it does %zone.brick = %brick or something similar.

Then do %trigger.brick  in that code above.

Make so when the zone is created, that it does %zone.brick = %brick or something similar.

Then do %trigger.brick  in that code above.
While testing, I thought of that. Trying now.

EDIT: I'm using an edited version of MeltingPlastic's zones and when I dumped the trigger's data I saw that there was a triggerBrick var, thanks anyway Chrono.
« Last Edit: March 13, 2010, 06:31:00 PM by HellsHero »