GUI Only Appears for First Player — Not for Others

I have a MenuGui that should be visible to all players when they join the game. However, it only appears for the first player who joins. Any players who join afterward don’t see the GUI at all.

What I’ve Checked

  • MenuGui is located inside StarterGui, so it should be cloned into each player’s PlayerGui on join.
  • I checked all existing scripts in the game.
  • The only script that references or handles the MenuGui is a script called MenuHandler.
  • None of the scripts are explicitly destroying or hiding MenuGui.

Behavior

  • First player joins: MenuGui works fine.
  • Subsequent players: MenuGui is missing.

Script:

local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Camera = workspace.CurrentCamera

local player = Players.LocalPlayer
local MainMenuGui = script.Parent
local deployButton = MainMenuGui:WaitForChild("DeployButton")
local blackOverlay = MainMenuGui:WaitForChild("Black")
local music = MainMenuGui:WaitForChild("GameMusic")
local gameGui = player:WaitForChild("PlayerGui"):WaitForChild("GameGui")

local menuCam = workspace:WaitForChild("MenuCam")

local function Setup()
	Camera.CameraType = Enum.CameraType.Scriptable
	Camera.CFrame = menuCam.CFrame

	if MainMenuGui then
		MainMenuGui.Enabled = true
	end
end

local ReturnToMenuEvent = ReplicatedStorage:FindFirstChild("Misc") and ReplicatedStorage.Misc:FindFirstChild("Events") and ReplicatedStorage.Misc.Events:FindFirstChild("ReturnToMenu")
local TeleportMe = ReplicatedStorage.Misc and ReplicatedStorage.Misc.Events and ReplicatedStorage.Misc.Events:FindFirstChild("TeleportMe")

local inMenu = true
local transitioning = false

local function fade(toTransparency, time)
	return TweenService:Create(blackOverlay, TweenInfo.new(time), {Transparency = toTransparency})
end

MainMenuGui.DeployButton.Activated:Connect(function()
	if transitioning then return end
	transitioning = true

	fade(0, 1):Play()
	TweenService:Create(music, TweenInfo.new(1), {Volume = 0}):Play()

	task.wait(1.5)

	music:Stop()
	MainMenuGui.Enabled = false
	gameGui.Enabled = true
	Camera.CameraType = Enum.CameraType.Custom

	TeleportMe:FireServer(true)
	fade(1, 1):Play()
	inMenu = false
	transitioning = false
end)

UserInputService.InputBegan:Connect(function(input, gameProcessed)
	if gameProcessed or inMenu then return end
	if input.KeyCode == Enum.KeyCode.M then
		inMenu = true

		ReturnToMenuEvent:FireServer()
		TeleportMe(false)

		Setup()
		gameGui.Enabled = false
		music.Volume = 1
		music:Play()
	end
end)

Setup()

I don’t really understand the script, you should copy ur script and paste it to ur message with codeblock

Done. Let me know if anything’s unclear!

The problem may be in

if MainMenuGui then
	MainMenuGui.Enabled = true
end

end

If the main menu UI is not the parent of the script, it does not become visible. Try removing that line and only keeping ‘’MainMenuGui.Enabled = true” or, add a WaitForChild()

I made the changes, but the issue is still happening.

I ran the command, but unexpectedly the GUI still didn’t show up. I also have a script that loops through PlayerGui to check if anything was disabled or destroyed, and none of the checks triggered any warnings

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

local guiStates = {}
local function updateGuiStates()
	for _, gui in ipairs(playerGui:GetChildren()) do
		if gui:IsA("ScreenGui") and guiStates[gui] == nil then
			guiStates[gui] = gui.Enabled
		end
	end
end

updateGuiStates()
while true do
	for gui, previousState in pairs(guiStates) do
		if gui:IsDescendantOf(game) then
			if previousState == true and gui.Enabled == false then
				warn("GUI disabled suddenly: " .. gui.Name)
			end
			guiStates[gui] = gui.Enabled
		else
			warn("GUI was destroyed or removed: " .. tostring(gui.Name))
			guiStates[gui] = nil
		end
	end
	updateGuiStates()
	wait(0.5)
end

Just to confirm, this is a local script parented to the GUI. Right?

1 Like

So just to be clear: The menuGui doesn’t get cloned at all to any subsequent players? Like its literally not in their playerGui?