Skip to main content

Installation

1

Download

Get the latest release from our Tebex store and download it from your Keymaster
2

Extract

Extract the script folder to your server’s resources directory
3

Configure

Add ensure spooni_stockmarket to your server.cfg
4

Customize

Configure the script to your liking using the configuration options
5

Restart

Restart your server to activate the stock market system

Configuration

The script is configured through the config/config_stockmarket.lua file. Here are the main configuration sections:

General settings

config.lua

Administration settings

config.lua
To set up admin permissions, add the following line to your server.cfg:

Command configuration

config.lua

Location-based access

config.lua
The prompt key 0x760A9C6F corresponds to the G key. You can change this to any other key code as needed.

Database setup

The database is created automatically when the resource is started. The system includes the following tables:
  • stocks: Stock definitions and configuration
  • player_portfolios: Player investment tracking
  • transactions: Trade history and audit trail
  • dividends: Dividend payout records
The database structure is automatically managed by the script. No manual database setup is required.

Sample stocks

Here are 5 sample stocks you can add to your database after starting the script for the first time:

Real-time stock symbols

You can choose from over 100 real-world stock symbols. Here are some popular options:
AAPL, MSFT, GOOGL, GOOG, NVDA, META, TSLA, ADBE, CRM, INTC, QCOM, IBM, ORCL, NOW, PANW
BRK.B, JPM, V, MA, BAC, WFC, GS, C, MS, SCHW, AXP, BLK, SPGI, CB, MMC
UNH, JNJ, PFE, LLY, ABBV, MRK, ABT, TMO, DHR, BMY, GILD, MDT, SYK, ISRG, VRTX
AMZN, HD, WMT, MCD, SBUX, TGT, TJX, COST, MCD, DIS, NFLX, NKE, PM, MO
XOM, CVX, COP, NEE, DUK, SO, CAT, LMT, RTX, NOC, HON, DE, UPS, FDX
To request specific stock symbols or get the complete list, please visit our Discord server.

Framework integration

The script includes built-in support for multiple frameworks:

Performance considerations

The script is optimized for performance with several key features:
  • Efficient database queries: Optimized database operations for large datasets
  • Configurable update intervals: Control how often prices update to balance accuracy and performance
  • Caching system: Price data is cached to reduce API calls
  • Batch processing: Multiple operations are processed in batches

Performance tips

  • Update intervals: Set appropriate price update intervals (12 hours recommended)
  • Stock count: Limit the number of active stocks to essential ones
  • API limits: Be mindful of real-time API rate limits
  • Database maintenance: Regularly clean old transaction records

Troubleshooting

Check the price update interval configuration, verify API connections for real-time stocks, and ensure the script is properly started in server.cfg.
Verify API credentials are correct, check network connectivity, and ensure the stock symbol is valid and supported.
Check dividend configuration settings, verify the payout day is set correctly, and ensure dividends are enabled for the specific stock.
Verify database connectivity, check for database errors in console, and ensure the database tables were created properly.
Confirm RP events are enabled in configuration, check event trigger conditions, and verify the event system is properly integrated.
Verify admin permissions are set correctly in server.cfg and check the isAdmin function configuration in config.lua.
Check the coordinates and distance settings in Config.Locations, verify the prompt key is correct, and ensure the location is properly configured.

Support

If you encounter issues or need assistance:

Discord support

Join our Discord community for support and updates.

Developer reference

API details and configuration hooks for this script.