🌏Spawnselector / Spawn

You can follow the methods below to integrate the spawnselector or to spawn automatically in the last position.

ESX Spawnselector Integration

When you do not integrate spawnselector in ESX, you are automatically spawned in the last position.

To activate the Spawnselector, find the function below and follow the steps.

Config.SpawnSelector = function()
    -- ONLY USE FOR ESX FRAMEWORKS
    -- You can spawn the character selector with export or trigger here
    -- if you put the export or trigger please change return value to true
    
    TriggerEvent('your-spawnselector-trigger-here')
    exports['your-script']:openUI()
    return true
end

When you put an export or event, you should return true.

When you delete the Export or Event, you have to return false again. Please note that


QBCore Spawnselector Integration

If you are using qb-apartment and qb-spawn, the script will automatically bring the spawnselector to your screen.

If you are using a different script, if it is available in qb-apartment events, it will open automatically. You can detect it by trial and error.

To activate the Spawnselector, find the function below and follow the steps.

Config.CharacterSelected = function(charid, skinData)
    -- When a person selects a character and presses the play button, the selected character comes as citizenid or char1...5
    -- You can spawn the character selector with export or trigger here. 
    -- skinData = {model = charModel, skin = charSkin}

    -- THESE PLACES ARE ACTUALLY FULL OF CODES

    -- THESE PLACES ARE ACTUALLY FULL OF CODES

    TriggerEvent('your-spawnselector-trigger-here')
    exports['your-script']:openUI()
end

Last updated