# π Sal's Kewl Spawn Selector π
**Version 1.5.1**

## The Ultimate Spawn Selection Experience for Your FiveM Server
Are your players tired of boring spawn screens? Upgrade your server with **Sal's Kewl Spawn Selector** - a premium, feature-rich spawn selection script designed for QBCore servers!
---
## β¨ Key Features
- **Beautiful, Responsive UI** - Sleek, modern interface that looks great on all devices
- **Multiple Spawn Types** - Support for both new characters and existing players
- **Job-Based Spawn Points** - Only show relevant spawns based on player's job
- **Last Location** - Players can spawn at their last location with a preview image
- **House Integration** - Seamless integration with housing scripts for property spawns
- **Exact Interior Positioning** - Precise spawn coordinates for interiors with no falling issues
- **QBCore Compatible** - Drop-in replacement for qb-spawn with zero hassle
- **Customizable Without Editing Core Files** - Modify functionality without touching encrypted components
- **Static or Dynamic Backgrounds** - Choose between dynamic spawn point images or a single custom background
- **Virtually guaranteed Correct Character Appearance** - Multiple systems ensure players always see their correct character model
---
## π What Sets Us Apart
### π Encrypted Core with Open Customization
The core files are encrypted to protect intellectual property, but all customizable functionality is available in separate files you can freely modify:
- `client_customize.lua` - For client-side customization
- `server_customize.lua` - For server-side customization
### π Flexible Housing Integration
Easily add support for any housing script by modifying a few functions. Default support for loaf_housing is included, with examples for qb-houses and others.
### πΌ Advanced Job-Based Spawns
Define spawn points for specific jobs or job groups. Police officers see police stations, EMS see hospitals, mechanics see garages - creating an immersive experience for different roles.
### πΈ Location Previews
Dynamic previews of spawn locations help players make better decisions about where to spawn.
### π« No More Falling Through Floors!
Our advanced spawn handling ensures players never fall through the ground in interiors or complex buildings.
### π€ Perfect Character Appearance System
Our appearance system works flawlessly with illenium-appearance and qb-clothing, ensuring players always see their correct character model during the spawn selection process. No more default models or appearance flickering!
### π οΈ Admin Commands
Powerful admin commands for managing spawns:
- `/spawnmenu` - Opens the spawn selector
- `/setspawn [x] [y] [z] [h] [playerID]` - Set spawn location for any player
- `/reloadspawns` - Reload all spawn configurations
### π¨ Fully Customizable UI
Server owners can customize the entire look and feel of the spawn selector:
- Choose between light and dark themes
- Set animation types and transition effects
- Use dynamic spawn point images or a single static background
- Configure blur effects and visual elements
- Customize via configuration or programmatically through the API
---
## π Customizable Functions
### Client-Side
- **GetPlayerHouses** - Fetch houses from any housing script
- **SpawnPlayerInHouse** - Handle spawning inside houses
- **OnPlayerSpawned** - Run code after spawning
- **HasPermissionForSpawn** - Custom permission checks
- **GetAdditionalSpawnPoints** - Add spawns programmatically
- **CustomGroundDetection** - Custom floor detection logic
- **PreloadAppearance** - Advanced character appearance handling
### Server-Side
- **HasPermission** - Custom permission systems
- **SaveLastLocation** - Custom location saving
- **EnsurePlayerAlive** - Fix player health after spawning
- **ValidateSpawnPoint** - Validate spawn coordinates
- **OnPlayerSpawned** - Server-side post-spawn actions
- **PreloadPlayerAppearance** - Server-side appearance loading
---
## π Perfect Compatibility
- **QBCore Framework** - Built specifically for QBCore
- **All Housing Scripts** - Easily adaptable to any housing system
- **Multiple Job Systems** - Works with any job configuration
- **Character Creators** - Seamless integration with character selection
- **Appearance Systems** - Works with illenium-appearance, qb-clothing and other appearance systems
---
## π¬ What Our Users Say
> "The customization files are a game-changer. We integrated our custom housing script in minutes without touching the core files!" - Server Developer
> "Finally a spawn selector that doesn't make players fall through the floor in buildings! The exact interior positioning works perfectly." - FiveM Server Owner
> "The job-specific spawn points changed our RP experience completely. Officers spawn at stations, EMS at hospitals - it's so immersive!" - RP Community Admin
> "The appearance preloading system is brilliant! No more naked characters or clothing flashes when players spawn." - Server Owner
---
## π Comprehensive Documentation
- Detailed installation guide
- Configuration reference
- Customization examples
- Troubleshooting section
- Integration tutorials
Full HTML documentation included in `docs/help.html`!
---
## π° Pricing
**Standard License**: $24.99 (Limited time price of $21.00)
---
## π± Contact
For inquiries, custom features, or support:
- Discord: https://discord.gg/CVWZb6AEwy
---
## π Elevate Your Server's First Impression Today!
*Sal's Kewl Spawn Selector - Customizable. Beautiful. Reliable.*
### π’ Latest Updates
#### Version 1.5.1
- Fixed NUI error in script.js: "Uncaught ReferenceError: spawnLocations is not defined"
- Improved background image handling in the UI
- Enhanced UI stability during spawn selection
- Fixed edge cases with spawn option selection
- Optimized UI script for better performance
#### Version 1.5.0
- **Major Character Appearance System Overhaul**
- Completely redesigned appearance loading system for better stability
- Fixed issue with default character models appearing during spawn selection
- Added robust support for illenium-appearance and qb-clothing
- Implemented multiple layers of fallback mechanisms for appearance loading
- Enhanced server-side appearance handling
- Fixed timing issues that caused character model reversion
- Improved modularity with customizable appearance functions
- Added more debugging tools for easier troubleshooting
#### Version 1.4.4
- Fixed appearance loading to ensure character model is correctly loaded BEFORE showing spawn UI
- Eliminated duplicate appearance loading after spawn selection
- Added intelligent appearance checks to prevent unnecessary reloads
- Fixed formatting for debug timestamps to work in all FiveM environments
- Improved UI loading by integrating jQuery properly
- Enhanced error handling during appearance loading process
- General improvements to appearance loading system stability
#### Version 1.4.3
- Fixed appearance loading issues with player models showing default clothing
- Eliminated duplicate appearance loading that caused character model to change after spawning
- Added intelligent checking to prevent appearance reloading if player already has proper clothing
- Enhanced debugging functionality for easier troubleshooting
- Improved compatibility with jQuery in the UI components
- Fixed timestamp function to work in all FiveM environments
- Added safeguards to prevent unnecessary appearance loading
#### Version 1.4.2
- Implemented smart appearance detection to avoid unnecessary reloads
- Enhanced appearance loading with fade effects for smoother transitions
- Improved character visibility control during appearance loading
- Added multiple parallel loading methods for greater reliability
- Fixed timing issues with appearance systems
#### Version 1.4.1
- Major overhaul of appearance preloading system
- Now loads character model and appearance before showing spawn selector
- Fixed metadata errors with illenium-appearance integration
- Greatly improved spawn experience with proper character models from the start
- Added comprehensive debug logging for appearance loading process
#### Version 1.4.0
- Added advanced appearance preloading system
- Characters now spawn with their correct model and clothing
- Eliminated "naked character" issue during spawn process
- Improved compatibility with various clothing/appearance scripts
- Enhanced error handling for appearance loading failures
#### Version 1.3.7
- Fixed critical illenium-appearance error: "attempt to index a nil value (field 'metadata')"
- Added comprehensive error handling for all appearance loading operations
- Implemented metadata field initialization for players with incomplete data
- Extended retry system with increased timeouts for more reliable appearance loading
- Improved debugging output to help troubleshoot appearance issues
#### Version 1.3.6
- Fixed player models appearing as default ped (NPC) after spawn
- Completely overhauled appearance loading system
- Added multi-stage loading with fallbacks for reliable appearance
- Resolved illenium-appearance metadata errors
- Implemented default model fallback as safety measure
#### Version 1.3.5
- Fixed issue with players spawning on building rooftops
- Enhanced character appearance loading for illenium-appearance
- Implemented multiple redundant methods to ensure skins always load
- Improved interior spawn handling to maintain precise positioning
#### Version 1.3.4
- Fixed critical bug with interior detection
- Enhanced stability when spawning in buildings
- Improved compatibility with the latest FiveM platform updates
#### Version 1.3.3
- Automatic integration with illenium-appearance and QB-clothing
- Fixed issue with player clothing not loading after spawn
- Smart detection of available appearance systems
#### Version 1.3.2
- Standardized job-based spawn configuration for easier setup
- Simplified job-based access controls
- Enhanced code clarity and maintainability
#### Version 1.3.1
- Added support for static background images
- Customizable UI themes and animations
- Improved visual effects and transitions
## π₯ Installation
1. Download the resource and add it to your server resources folder
2. Add `ensure sals_kewlspawnselector` to your server.cfg (after qb-core)
3. Ensure that qb-spawn is not running at the same time
4. Configure the settings in `config.lua` to match your server's needs
5. Restart your server and enjoy!
---
## π― User Testimonials
> "This is hands down the best spawn script I've used. My players love the clean UI and having their character model loaded properly during spawn selection!" - **ServerOwner123**
> "The job-based spawns are a game-changer for roleplay. Officers spawn at police stations, doctors at hospitals - it's so immersive!" - **RPMaster**
> "Finally a spawn selector where my character doesn't flicker between models! The appearance system works perfectly with illenium-appearance on our server." - **FiveM_Enthusiast**
---
## π Changelog
### Version 1.5.1 (Latest)
- Fixed NUI error in script.js: "Uncaught ReferenceError: spawnLocations is not defined"
- Improved background image handling in the UI
- Enhanced UI stability during spawn selection
- Fixed edge cases with spawn option selection
### Version 1.5.0
- **Major Character Appearance System Overhaul**
- Completely redesigned appearance loading system
- Fixed issues with default character models appearing during spawn
- Added robust support for illenium-appearance and qb-clothing
- Improved character model stability across different scenarios
- Optimized loading times for faster appearance rendering
- Added intelligent verification systems to ensure correct appearance
- Implemented fallback mechanisms for appearance loading
- Enhanced server-side appearance synchronization
### Version 1.4.5
- Added support for job-specific spawn points with grade requirements
- Improved UI responsiveness and animations
- Enhanced camera preview system for spawn locations
- Added better error handling for spawn location validation
- Fixed issues with last location spawning
### Version 1.4.0
- Added support for housing integration with loaf_housing
- Implemented customizable spawn sections
- Added theme support with light and dark modes
- Improved camera transitions between spawn options
- Added support for custom spawn point images
---
## π Support
Need help with setup or customization? Contact us:
- Discord: https://discord.gg/CVWZb6AEwy
---
**Sal's Kewl Spawn Selector** - Elevate your server's first impression!