G1R:MP Forum Alpha
Log in Join
Gothic 1 Remake Multiplayer

The Colony Forum

News, support, development discussions, server communities, and stories from beyond the Barrier.

Colony discussion

onPlayerJoin event bug

Started by Xardas0327 in Bug Reports

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
08-31-2026, 03:31 PM
#1
If we try to call the spawnPlayer or the setPlayerPosition in the onPlayerJoin.
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
Forum Jump: