GTA Money Boost Script NightClubSafeLoop.lua — A Lightweight GTA Online Nightclub Safe Income Automation Script
Introduction
NightClubSafeLoop.lua is a lightweight automated nightclub passive income loop for GTA Online. This loop is not intended to recover your money from a hack or to create a full-fledged menu, but simply to automate the process of getting maximum possible income from a nightclub. Nightclubs generate passive income based upon their popularity. However, the way they work presents a few problems.
- Popularity will naturally drop off over time.
- The payouts are made on a predetermined schedule.
- You have to manually collect the safe.
- If the safe gets too full, there will be no more payouts.
This loop solves all of those problems by:
- Making sure the nightclub's popularity stays at the highest level.
- Causing the payout timer to go down to zero every time.
- Automatically collecting the safe once the preset amount of cycles are done.
Therefore, you will get a continuous flow of income from your nightclub with minimal player interaction.
In-Game Pitcture :
Organization and Structure of the Script
The organization and structure of this script is quite simple. It consists of four main sections:
- Stat setter alias and globals.
- Function for collecting the safe.
- Logic and variables for the loop counter and timing.
- Main logic for the loop.
Each part of the script serves one primary function in keeping your nightclub income flowing.
NightClubSafeLoop.lua is a compact, simple, and specifically-designed automation script to illustrate how GTA Online’s passive income mechanism from Nightclubs can be modified with stat and global writes. By constantly maintaining the highest possible popularity, forcing the payout timers, and collecting the safe at periodic intervals, it provides a constant source of income from a nightclub with minimal player interaction. One reason the script is strong is due to its simplicity: fewer moving parts, clearer intent, and more predictable behavior. Although it may not have the safeguard features of more advanced automation loops, it still is an effective method for creating a controlled freemode session to farm Nightclub income.
Video of the Script
Credits to Dev - #L7NEG Sharing the Script
Download Links:
Stat Setter Alias
At the beginning of the script is the following line:
ncs = stats.set_int
This sets up a shorthand alias for the stat-setter function. Instead of continually writing stats.set_int, the script uses ncs() for ease of use and shorter lines. This alias is only used to set Nightclub stats, so it is very obvious what is being set in each case.
Globals Used to Define the Nightclub Safe
The script also sets up a table to define the global IDs for safe collection:
local safe_globals = {2708201, -- Nightclub}
Why Use Globals?
GTA Online handles business safe collection via script globals instead of stats. Writing to a global ID for a business safe collection triggers the same internal logic as manually collecting the safe in-game. By storing the global ID in a table, the script allows:
- Expansion to other safes easily.
- Magic numbers kept away from the logic.
- Improved readability.
Safe Collection Function
The function for collecting all safe earnings is:
function collect_all_safe_earnings()
log.info("Trying to collect safe earnings.")
for _, global_id in ipairs(safe_globals) do
ScriptGlobal.new(global_id):set_int(1)
end
notify.success("Lua Script", "Collected safe earnings.")
end
How It Works
- Logs a debug/monitoring statement.
- Iterates over all defined safe globals.
- Sets each global to 1, which causes safe collection.
- Displays a success notification when the safe is collected.
This mimics the process of selecting "Collect" within the Nightclub Office, but requires no player input.
Counter Logic
The script has a counter:
local loop_count = 0
This counter is used to determine when the safe should be collected. Instead of collecting the safe every cycle (which can cause transaction conflict), the script collects it after a predefined number of iterations. This helps provide more reliability and lessens the chances of transaction overlap.
Infinite Loop Execution
The core logic of the script is executed in:
script.run_in_callback(function()
while true do
...
end
end)
This creates a controlled infinite loop that runs in a safe callback environment and allows for yields without freezing the game.
Maximizing Club Popularity
Within the loop, the script continually sets:
ncs("mpx_club_popularity", 1000)
Why 1000?
Club popularity in GTA Online ranges from 0 to 1000 internally. When popularity is set to 1000, it guarantees:
- Highest possible income.
- Zero popularity decay.
- No need to complete popularity missions or hire employees.
This stat is continually written to prevent any natural decay over time.
Forcing Passive Payouts
Right after setting popularity, the script continually writes to:
ncs("mpx_club_pay_time_left", -1)
What This Does
The club_pay_time_left stat is what determines the countdown for the next Nightclub payout. By writing -1 to this stat, the script forces the timer to expire right now, which causes the game to deposit nightclub income on the next tick. This is how Rockstar uses the timer internally to trigger a payout.
Yielding After Each Loop Iteration
At the end of each loop iteration, the script yields:
script.yield(7000)
This introduces a 7-second delay between payout attempts. The yield provides:
- Relaxed looping.
- Decreased CPU load.
- Sufficient time for the game’s transaction processing to finish payouts safely.
Timing of Safe Collections
After every 5 iterations, the script calls:
if loop_count >= 5 then
script.yield(5000)
collect_all_safe_earnings()
loop_count = 0
end
Why Is This Important?
Instead of continually collecting the safe, the script:
- Introduces an approximate 35-40 second delay between collections.
- Includes a 5 second additional buffer before attempting collection.
- Resets the loop counter after each collection.
This spacing aids in avoiding:
- Transaction conflicts.
- Failed collections.
- Desync issues.
Overall Timing of the Script
When combining all the yields:
- Each loop runs about every 7 seconds.
- Collections occur approximately every 40 seconds.
- Additional buffer added before collection to ensure all transactions settle.
This pace achieves a good balance of speed and reliability.
Logging and Notification
The script contains two types of feedback:
log.info()for console messages.notify.success()for screen confirmations.
Both are optional but provide:
- Ability to monitor script activity.
- Confirmation that collections are working properly.
- Ability to debug issues if income ceases.
Why This Script Was Built So Simply But Effectively
Compared to the larger and more complex automation scripts available, NightClubSafeLoop.lua was built to avoid:
- Session detection code.
- Checks of transaction states.
- Heuristics that require a lot of knowledge.
- Persistence tracking for statistics.
This simplicity offers advantages:
- Less opportunity for errors.
- Easier to troubleshoot.
- Reduced overhead.
However, it assumes the player is already in a freemode session with Nightclub income enabled.
Limitations And Things To Be Aware Of
As with most things, the script has limitations:
- Does not detect unsupported sessions.
- Does not verify if the payouts were successful.
- Does not detect when the safe is full.
- Does not check for pending transactions.
Due to these limitations, it is best to run this script in:
- Stable freemode sessions.
- Fast network environments.
- Short to Medium Length Run Times.
Use Cases For This Script
This script is often used for:
- Passive income from AFK Nightclub.
- Testing the payout mechanics for Nightclub income.
- To keep popularity at the highest level without completing popularity missions.
- Lightweight automation without a high scripting overhead.
It is not suitable for:
- Mission Lobbies.
- Activity Sessions.
- Unattended Runtime Loops Longer Than Short-Medium.
Comparison To Agency Or Arcade Loops
Compared to more complex loops (like Agency or Arcade loops), NightClubSafeLoop.lua is:
- Faster and smaller.
- Less Defensive.
- Easier to Modify.
- More dependent on ideal conditions.
More complex loops usually contain session detection and transaction-safe checks; this script chose to prioritize simplicity.
Possible Improvements
If this script is to be improved, some possible enhancements are:
- Detection of supported sessions.
- Verification of safe values.
- Pending transaction checks.
- Safe capacity monitoring.
- Total income logged.
These enhancements would help make the loop more reliable for longer-term operation, but would also add complexity.
Conclusion
NightClubSafeLoop.lua is a compact, simple, and specifically-designed automation script to illustrate how GTA Online’s passive income mechanism from Nightclubs can be modified with stat and global writes. By constantly maintaining the highest possible popularity, forcing the payout timers, and collecting the safe at periodic intervals, it provides a constant source of income from a nightclub with minimal player interaction. One reason the script is strong is due to its simplicity: fewer moving parts, clearer intent, and more predictable behavior. Although it may not have the safeguard features of more advanced automation loops, it still is an effective method for creating a controlled freemode session to farm Nightclub income.



