If we try to call the spawnPlayer or the setPlayerPosition in the onPlayerJoin.
They don't work and they return false.
Result:
They don't work and they return false.
Quote:addEventHandler("onPlayerJoin", root, function(playerId)
outputDebugString("onPlayerJoin Start")
if spawnPlayer(playerId, 12.0, 24.0, 2.0, 90) then
outputDebugString("Spawned player " .. playerId)
else
outputDebugString("Failed to spawn player " .. playerId)
end
if setPlayerPosition(playerId, 12.0, 24.0, 2.0, 90) then
outputDebugString("Set player position for " .. playerId)
else
outputDebugString("Failed to set player position for " .. playerId)
end
outputDebugString("onPlayerJoin End")
end)
Result:
Quote:[lua][chat][info] onPlayerJoin Start
[lua][chat][info] Failed to spawn player 1
[lua][chat][info] Failed to set player position for 1
[lua][chat][info] onPlayerJoin End