This script works,its just that i want that all the players still alive to be writen on the Gui
How i modify this script so when the ”timer”( i ) = to 0 all players that are still on the map(Not in the lobby) are written on the Status.Value? (which is a GUI)
Status.Value its a Gui
i are sec, its a working timer
reward =1
#plrs its a list of players that are in the table Status.Value = "There are "..i.." seconds remaining, and "..#plrs.." players left" if i == 0 then -- timers goes to 0 Status.Value = "The winner is "..plrs[1].Name plrs[1].leaderstats.Bucks.Value = plrs[1].leaderstats.Bucks.Value + reward break elseif #plrs == 0 then Status.Value = "Nobody won!" break end
Well You can use a for loop to get to each player in the table.
for i = 1,#plrs do local plrnum = plr[i] local plrname = plrnum.Name print(plrname) end
The for loop runs through every single player in the table of players and gets out their name!
To see if players are still inside the map you can use the datatype region3 for that. You can use FindPartsInRegion3 and see if there is a humanoid. Find out the humanoid's parent and you have found a player on the map area.
To understand how to use Region3 and its functions red this article which is very well explained!
https://scriptinghelpers.org/questions/35877/quick-explanation-on-region3