{$CLEO .cs}

nop
:START
wait 0
int Give = 1
int Last_save_count = Memory.Read(0xB79040, 4, 0)
jump @CHECK

:CHECK
wait 0
if
    not Player.IsPlaying($player1)
then
    Give = 1
end
int save_count = Memory.Read(0xB79040, 4, 0)
if
    not save_count == Last_save_count
then
    Give = 1
    Last_save_count = save_count
end
if and
    Give == 1
    Player.IsPlaying($player1)
then
    Give = 0
    int armor = Player.GetMaxArmor($player1)
    int armor_now = Char.GetArmor($scplayer)
    armor -= armor_now
    Char.AddArmor($scplayer, armor)
end
jump @CHECK