Well pretty much then trigger works perfectly except it only adds to the varible rads every time the player touches the brick, when it needs to add every certain amount of MS
datablock fxDTSBrickData(RadiationBrickData : brick2x4FData)
{
category = "FalloutRP";
subCategory = "Wasteland Brick";
uiName = "Radiation Zone Minor";
triggerDatablock = RADZoneInputTriggerData;
triggerSize = "32 32 15";
trigger = 0;
};
//Loading Junk-_-
package Start
{
function gameConnection::onClientEnterGame(%client)
{
%client.Radsuit = 0;
Parent::onClientEnterGame(%client);
}
};
activatePackage(Start);
//trigger!
datablock TriggerData(RadiationBrickTriggerData)
{
tickPeriodMS = 100;
};
function RadiationBrickData::onPlant(%this, %obj)
{
%obj.createTrigger(RadiationBrickTriggerData);
}
function RadiationBrickTriggerData::onEnterTrigger(%this, %client, %trigger, %obj)
{
%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, RadLoop);
}
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;
}