Fix invincible ghost character creation on first join

Inventory sync will now wait intil the player has a character.
This means sync won't happen ex during respawn animations
or freeplay intro cutscenes.
This commit is contained in:
Daniel committed 2021-07-12 23:28:16 +02:00
1 parent 4027a4f310
commit 1a1b4fb0d2
3 files changed
+37 -15

No files matched your search

@@ -1,13 +1,9 @@
local ensure_character = require("modules/inventory_sync/ensure_character")
local function welcome_new_player(player_name)
local player = game.get_player(player_name)
if player == nil then return end
player.print("Welcome to the server!")
player.print("Your inventory will be automatically synchronized between servers in this cluster.")
player.print("To improve sync performance, please avoid storing blueprints in your inventory.")
ensure_character(player)
end
return welcome_new_player