Event only firing for one person in the server

You can write your topic however you want, but you need to answer these questions:
I am trying to make a system where after the timer finishes, all players have a faded black screen and teleport to the lobby but it only teleports for one person when there are multiple in the game.

Here is the code for the server script inside of server script service:

function Format(Int)
	return string.format("%02i", Int)
end

function convertToHMS(Seconds)
	local Minutes = (Seconds - Seconds%60)/60
	Seconds = Seconds - Minutes*60

	return Format(Minutes)..":"..Format(Seconds)
end -- nothing here important

while true do -- game running loop
        local gameTime = 30
		for i=gameTime,0,-1 do
			if game.ReplicatedStorage.WinnerValue.Value == false then
				gameTime = convertToHMS(i) -- eg converting 120 seconds to 2:00
				game.ReplicatedStorage.GameStart:FireAllClients(gameTime) -- this event works fine for the while server to see the time ticking
				wait(1)
			end
		end
		if gameTime == "00:00" then -- when the time reaches 0,

			print(gameTime)
			game.Workspace.GameSound.Playing = false -- this works for everyone
			game.ReplicatedStorage.LobbyTp:FireAllClients() -- THIS EVENT ONLY SENDS TO ONE PERSON
			resetButtons()
			gameRestart:FireAllClients() -- this works for everyone too
			wait (4)

		end
		
	end

end

Here is the code inside of a LocalScript inside of StarterGui:

game.ReplicatedStorage.LobbyTp.OnClientEvent:Connect(function()	
	local fadeIn = TweenService:Create(script.Parent.Parent.Parent,guiOpen,{BackgroundTransparency = 0})
	local fadeOut = TweenService:Create(script.Parent.Parent.Parent,guiClose,{BackgroundTransparency = 1})
	fadeIn:Play()
	wait (2)
	local spawnNumber = math.random(1,8)
	if spawnNumber == 1 then
		player.Character.PrimaryPart.CFrame = game.Workspace.Tp1.CFrame
	end
	if spawnNumber == 2 then
		player.Character.PrimaryPart.CFrame = game.Workspace.Tp2.CFrame
	end
	if spawnNumber == 3 then
		player.Character.PrimaryPart.CFrame = game.Workspace.Tp3.CFrame
	end
	if spawnNumber == 4 then
		player.Character.PrimaryPart.CFrame = game.Workspace.Tp4.CFrame
	end
	if spawnNumber == 5 then
		player.Character.PrimaryPart.CFrame = game.Workspace.Tp5.CFrame
	end
	if spawnNumber == 6 then
		player.Character.PrimaryPart.CFrame = game.Workspace.Tp6.CFrame
	end
	if spawnNumber == 7 then
		player.Character.PrimaryPart.CFrame = game.Workspace.Tp7.CFrame
	end
	if spawnNumber == 8 then
		player.Character.PrimaryPart.CFrame = game.Workspace.Tp8.CFrame
	end
	wait (2)
	fadeOut:Play()
	
	script.Parent.Visible = true
	TextLabel.Text = " "
end)

No matter how many times I try, the event only fires to me when I am playing with my alt account in-game. The ServerScript works for everyone but the LocalScript just for me.

The Explorer looks like this:

Any help would be greatly appreciated!

Does the fade in happen for all players?

No, that’s the problem. It only happens to one player when it should be an event for the entire server

Inside

game.ReplicatedStorage.LobbyTp.OnClientEvent:Connect(function()	

add print(“Lobby Tp fired”) at the first line and see if it actually prints this on one account and not the other.

It worked perfectly in studio and printed it, but once I go into the actual Roblox game on 2 accounts it only works for one of them

The event should work fine for all players.
Can you try Test round with 2 players in roblox studio and share what was the result?

Is the event connection being created before the RemoteEvent has loaded in on the client? Try adding a WaitForChild for the RemoteEvent before making the connection.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.