How to make a minigame script

I have made a minigame script but I don’t know how to properly check which player is in game I know you can use a table but how would I know in which number of the table the player is. Another solution would be adding a intvalue into the player called in game. If anyone knows and good and efficient way please comment

Yes. Use game.Players.PlayerAdded and create an IntValue with the number of the game that they are playing. Update whenever the player starts a new minigame.

how about the table method, how would it work?

Well, I’m not sure, but you can get the number of the table that the player is by creating a function:

function getplayerInTable(player, table)
    for i, v in pairs(table) do
        if v and v == player then
            return i
        end
    end
end)

I am trying to make a game called spleef run where it’s spleef so you get a shovel to spleef others and you also have to keep walking to not fall cause when touching the part it will fade away and disappear