Author Topic: Why is this Loop within a trigger giving an Error?  (Read 1017 times)

I dont get why it is giving me a error?

Code: [Select]
datablock fxDTSBrickData(RadiationBrickData : brick2x4FData)
{
category = "FalloutRP";
subCategory = "Wasteland Brick";

uiName = "Radiation Zone Minor";

triggerDatablock = RADZoneInputTriggerData;
triggerSize = "32 32 15";
trigger = 0;
};
//Loading Junk-_-
function gameConnection::onClientEnterGame(%client)
{
%client.Radsuit = 0;
}
//trigger!

datablock TriggerData(RadiationBrickTriggerData)
{
tickPeriodMS = 100;
};

function RadiationBrickData::onPlant(%this, %obj)
{
%obj.createTrigger(RadiationBrickTriggerData);
}

function RadiationBrickTriggerData::onEnterTrigger(%this, %client, %trigger, %obj)
{

cancel($RadLoop);

%count = clientGroup.getCount();

for(%i = 0; %i < %count; %i++)
{
%client = clientGroup.getObject(%i);

%if(%client.Radsuit > 0)
%client.Radiation += 1;

else
%client.Radiation +=2;
}

%RadLoop = schedule(1000, 0, walletDisplay);
}

function serverCmdyes(%client)
{
echo(%client.Radiation);
}

function FxDTSBrick::createTrigger(%this, %data)
{
%t = new Trigger()
{
datablock = %data;
polyhedron = "0 0 0 1 0 0 0 -1 0 0 0 1"; //this determines the shape of the trigger
};
missionCleanup.add(%t);
%boxMax = getWords(%this.getWorldBox(), 3, 5);
%boxMin = getWords(%this.getWorldBox(), 0, 2);
%boxDiff = vectorSub(%boxMax,%boxMin);
%boxDiff = vectorAdd(%boxDiff, "0 0 0.2");
%t.setScale(%boxDiff);
%posA = %this.getWorldBoxCenter();
%posB = %t.getWorldBoxCenter();
%posDiff = vectorSub(%posA, %posB);
%posDiff = vectorAdd(%posDiff, "0 0 0.1");
%t.setTransform(%posDiff);
%this.trigger = %t;
%t.brick = %this;
return %t;
}
its saying the error is here
Code: [Select]
%if(%client.Radsuit > 0)
« Last Edit: July 02, 2015, 11:33:31 PM by SuperFlaminninja³ »

You are aware that to do a /testRP command you need it to be serverCmdTestRP?

Actually i hit another problem
« Last Edit: July 02, 2015, 11:34:41 PM by SuperFlaminninja³ »

Don't edit your bloody posts please.

% doesn't go before an if statement.

% and $ at the start of a word represents a variable
% is a local variable inside of a function
$ is a global variable that can be called from anywhere

if statements are not variables

OMG im so sorry i didnt see that, i was tired