nononono
The GUI is client sided, these things should be server sided. What jes00 said is correct - you need to use a clientcmd to update the GUI. Your current solution may work in singleplayer but it won't work on a dedicated even for the first client, and it'll spam your console because stat1 doesn't exist. Or if it does you are horrid and have instantiated a gui object serverside. Don't do that.
Serverside code: This does all the actual work and lets the client know what's going on.
function Player::setRads(%player,%rads)
{
%player.rads = %rads;
cancel(%player.radSched);
if(%rads > 25)
{
%player.radSched = %player.schedule(10000,"takeRadDamage");
}
commandToClient(%player.client,'stalker_updateRads',%rads);
}
function Player::takeRadDamage(%player)
{
cancel(%player.radSched);
// This function would damage the player based on their rads or whatever here.
// %player.damage should automatically 'kill' the player if their health falls too so that shouldn't be an issue for this next part:
// Only continue to take rad damage if you aren't already dead. Not sure that's right, but I think it is.
if(%player.getState() !$= "Dead")
{
%player.radSched = %player.schedule(10000,"takeRadDamage");
}
}
Clientside code: This only updates the GUI object based on a value the server tells the client.
function clientCmdstalker_updateRads(%rads)
{
stat1.setValue(%rads);
}
Always make this distinction - the server.cs and client.cs files are separate for a reason.