Main Menu issues character auto load stuff

I’m trying to make a main menu for my game. I wan’t the player to be able to see then menu but I don’t want their Character to spawn in until they press play. Doesn’t anyone know what I should do? Note: when i turn off player autoloads and I try to play the game it like spawns me in the void?

1 Like

First things first is to disable the CharacterAutoLoad property of “Players”. Doing so, however, has a side effect. Nothing in StarterGui will load into the player’s PlayerGui until their character loads. However, you can clone a Gui into the player’s PlayerGui to counter this.

Here’s an example:

local players = game:GetService('Players')
players.CharacterAutoLoads = false

players.PlayerAdded:Connect(function(player)
	local gui = script:WaitForChild('ScreenGui'):Clone()
	gui.Parent = player:WaitForChild('PlayerGui')
	gui = nil
	player.CharacterAdded:Connect(function(character)
		character:WaitForChild('Humanoid').Died:Wait()
		task.wait(players.RespawnTime)
		player:LoadCharacter()
	end)
	task.wait(3) --delay until spawn
	player:LoadCharacter()
end)

Though instead of a timed delay, you’d probably hook up a load function to a remote. Such as when the player clicks play.

4 Likes

I type this in a server script right?

2 Likes

Thanks for your help I found out how to use remote events properly and I figured it out

2 Likes