Repeating

Postal3Script has a function called Repeat where you can repeat actions over and over again.

This is also possible in AngelScript thanks to Wait function.

Here's how you can do an infinite repeat as an example:

class Tut : IPostal3Script
{
    // This has to be executed once! (in it's own context)
    void CheckPlayer()
    {
        CP3SObj@ pPlayer = GetPlayer();

        // For some reason it's null
        if (pPlayer == null)
            return;

        string behavior = pPlayer.GetBehavior(); 
        behavior.toLower();

        // The Player is dead (the behavior's name changes when Dude dies in CR)
        if (behavior != "bh_player")
            return;

        // This checks if the Player's health is under 50, and if yes it'll set it back to 50.
        if (pPlayer.GetAttr("ea_health") < 50)
            pPlayer.SetAttr("ea_health", 50);

        Wait(3.0);

        // Recall the function
        CheckPlayer();
    }
}