How can I make the game skip players who have just recently joined?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I know this might be a very simple solution, but how can I make the round system check if new player(s) has joined and not have them participate in the round?
  2. What is the issue? Include screenshots / videos if possible!
    The game registers anyone who joins. Even if they join right when a round is starting, they will still get teleported.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I could trying getting ServerTimeNow with workspace:GetServerTimeNow() and then comparing that with when the player joined?
2 Likes

What signifies a player being in a round? A team change? Are they teleported somewhere?

1 Like

The players are teleported to a map.

You have the right idea with:

You can use any time function available on the server to mark when a player has joined and use that to check if they’ve been connected for some specified amount of time.

1 Like

I think what I’ll do is check for new players like every function. Like the intermission, round, and teleported back. I’m only checking for players during the intermission.

No, wait, or maybe like this:

while true do
	if workspace:GetServerTimeNow() - joinTime > 10 then
		RoundModule:Intermission(Players, Status, Intermission, IntermissionLength)
		RoundModule:StartRound(Players, Status, Arena, TeleportTo)
		RoundModule:EndRound(Players, Status, Arena, Target, LobbySpawn, RoundEnded)
		task.wait(20)
	end
end

This checks if the player has been in the game for more than 10 seconds I guess.

This prints out an error though (attempt to perform arithmetic on number and nil)

joinTime probably wasn’t set. I don’t know how your RoundModule works so I don’t know what to expect. I also don’t know how a player is excluded from play since I can’t see what Players is or how it’s modified by other code.

Yeah I want to end the round too if there’s not enough players or if someone dies.

You need to store information when player joined

player.JoinedTime = clock.time()

Later you compare it to current time

if clock.time() - player.JoinedTime > RequiredTime then
    -- Code to teleport player
end
1 Like

Is this a property? I’m unfamiliar with it. I need to study os library too.

You can store it inside table or create int value

local function OnJoin(player: Player)
    local JoinedTime = Instance.new("IntValue")
    JoinedTime.Name = "JoinedTime"
    JoinedTime.Value = clock.time()
    JoinedTime.Parent = player
end

game.Players.PlayerAdded:Connect(OnJoin)
1 Like

OH. thank you. I understand now.