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 directory3
Configure
Add
ensure spooni_stockmarket to your server.cfg4
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 theconfig/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:Technology stocks
Technology stocks
AAPL, MSFT, GOOGL, GOOG, NVDA, META, TSLA, ADBE, CRM, INTC, QCOM, IBM, ORCL, NOW, PANW
Financial stocks
Financial stocks
BRK.B, JPM, V, MA, BAC, WFC, GS, C, MS, SCHW, AXP, BLK, SPGI, CB, MMC
Healthcare stocks
Healthcare stocks
UNH, JNJ, PFE, LLY, ABBV, MRK, ABT, TMO, DHR, BMY, GILD, MDT, SYK, ISRG, VRTX
Consumer stocks
Consumer stocks
AMZN, HD, WMT, MCD, SBUX, TGT, TJX, COST, MCD, DIS, NFLX, NKE, PM, MO
Energy and industrial
Energy and industrial
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
Stocks not updating
Stocks not updating
Check the price update interval configuration, verify API connections for real-time stocks, and ensure the script is properly started in server.cfg.
Real-time data not working
Real-time data not working
Verify API credentials are correct, check network connectivity, and ensure the stock symbol is valid and supported.
Dividends not paying
Dividends not paying
Check dividend configuration settings, verify the payout day is set correctly, and ensure dividends are enabled for the specific stock.
Player portfolios not saving
Player portfolios not saving
Verify database connectivity, check for database errors in console, and ensure the database tables were created properly.
RP events not affecting prices
RP events not affecting prices
Confirm RP events are enabled in configuration, check event trigger conditions, and verify the event system is properly integrated.
Admin commands not working
Admin commands not working
Verify admin permissions are set correctly in server.cfg and check the isAdmin function configuration in config.lua.
Location access not working
Location access not working
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.