I am currently making an automated obstacle course game and came across a problem. I tried scouring for the solution but couldn't find one on google so I came here.
My problem is that, I want a single random player to be picked from a team and teleported onto a block automatically. This is the code I'm using.
local status = game.ReplicatedStorage:WaitForChild("Status")
playerpicked = 0
intdone = false
status.Value = "Loading..."
wait(2)
while intdone == false do
t = 10
repeat
t = t-1
status.Value = "Intermission.. "..t
wait(1)
until t == 0
status.Value = 'Starting..'
intdone = true
wait(2)
end
if intdone == true then
for i,v in pairs(game.Teams["In Tourney"]:GetPlayers()) do
--Having trouble figuring out what to do in here.
end
end
If you need further detail of the question or didn't understand something I was asking, please tell me and I will rephrase the question.

10 comments
u mean ur not using this site from google?
also what is this for
Haha, I just meant I couldn't find solutions that were already solved and or tutorials on youtube, so I had to ask one myself as it is a pretty specific question.
It's for a game I'm making which is a very hard obstacle course based off a real gameshow.
wowowo
also i believed it had been answered
GetPlayers returns an array which you can then use math.random with the min value and max value to create a random number that is within the number of players. Then just index the table.
aye
Also you do not want to be changing the time using a value in rep storage just send the player a timer to so they can count down.
What exactly do you mean by Indexing the table?