According to your script, after the initial activation the local variable
counter is set to 1 thereby preventing a second payout.
Counter is set back to 0 when
currentDay equals 1. There is no code in your script that sets
currentDay to 1, and unless it done remotely by another script or dialog results it will never happen.
I expect this is a local script attached to the chest that runs only when the player is in the same cell as the chest. This means that even if you have it set
currentDay to Day and check to see if it is equal to 1 it will work only if the player is in that cell on the first day of each month. More effective is to check to see if the month has changed to reset
counter. It is also not a good idea to enable/disable an object every frame. You might try something like this:
Begin oce_Earningsshort doOnceshort currentMonthshort playerPaidif ( doOnce == 0 ) set doOnce to 1 Disableendifif ( doOnce == 1 ) if ( ( GetJournalIndex "OCE_Armory" ) == 5 ) set doOnce to 2 Enable endifendif if ( OnActivate == 1 ) if ( playerPaid == 0 ) messagebox "You've collected your monthly earnings." player->AddItem "Gold_001" 500 PlaySound "Item Gold Up" ; this might happen automatically set playerPaid to 1 set currentMonth to Month elseif ( playerPaid == 1 ) messagebox "You've already collected your earnings for this month." endifendifif ( currentMonth != Month ) set playerPaid to 0endifEnd oce_Earnings
This code has not been tested.
Edit: typo