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)