I am trying to create a timer, but I want the timer to be fair by calculating all the players and giving the appropriate time.
For example, if one player joins the game then the timer will be 30 seconds, or if two players joined then it will be 60 seconds. How do I input this "method" into my timer? Any hints would be appreciated!
wait(1)
ftime = ftime - 1
text.Value = "Time remaining: "..ftime
local function TeamMembers(name)
local players = {}
for _, plr in pairs(game.Players:GetPlayers()) do
if plr.Team and plr.Team.Name == name then
table.insert(players, plr)
end
end
return players
end

5 comments
Thank you! I will try it now.
What if it's a server script? I'm getting 0 on server script except for local script.
makes no difference
if ur getting 0 it means the script is running before any players have finished loading, you may want to add a wait(10) or smth like that to it
Ok!