[Solved] Trying to load a model with spawnmanager

When i try to load a model with the spawnmanager the player cant join the game.
If i remove the model then each player gets the michael model when he joins the game.

client.lua

-- Spawn override
AddEventHandler('onClientMapStart', function()
    exports.spawnmanager:setAutoSpawn(true)
    exports.spawnmanager:forceRespawn()

    exports.spawnmanager:setAutoSpawnCallback(function()
        if spawnLock then
            return
        end

      --  spawnLock = true

        TriggerServerEvent('playerSpawn')
        TriggerEvent('playerSpawn')
    end)
end)

-- Allows the server to spawn the player
RegisterNetEvent('gamemode:spawnPlayer')
AddEventHandler('gamemode:spawnPlayer', function(x, y, z, model)
    exports.spawnmanager:spawnPlayer({x = x, y = y, z = z, model = model})
end)

server.lua

RegisterServerEvent('playerSpawn')
AddEventHandler('playerSpawn', function()
	TriggerClientEvent('gamemode:spawnPlayer', source, 436.491, -982.172, 30.699, 'a_m_y_skater_01')
end)

the spawnPlayer function takes a hash and and not a name also some hashes won’t work anyway (like s_m_y_cop_01)

1 Like

Oh that explains :smiley: thanks for the info @dysprosium

I need to Spawnpoint multiple random points. How to do?

Can you elaborate? Why hash won’t work?

i keep Spawning in as micheal and i dont know how to fix it