How do I run through all the players in a server, and set 16 groups of variables with Players Names and User Ids without any repeating! I ask this because I will have a brick in the game with a SurfaceGui and this will make all the information easier to access.
Here's what I have for the beginning of my function.
function HGSpawn() for i = 1,#AllPlayers do if AllPlayers[i]:WaitForChild("Settings"):WaitForChild("HG").Value == false then AllPlayers[i]:WaitForChild("Settings"):WaitForChild("HG").Value = true if HGS.HG1.Toggle.Value == false then HGS.HG1.Toggle.Value = true HGS.HG1.Avatar.Value = AllPlayers[i].UserId HGS.HG1.Player.Value = AllPlayers[i].Name elseif HGS.HG1.Toggle.Value == true then HGS.HG2.Toggle.Value = true HGS.HG2.Avatar.Value = AllPlayers[i].UserId HGS.HG2.Player.Value = AllPlayers[i].Name
Sorry, I'm new to scripting helpers... still trying to figure it out.
Heres the bad coding I did
function HGSpawn() for i = 1,#AllPlayers do if AllPlayers[i]:WaitForChild("Settings"):WaitForChild("HG").Value == false then AllPlayers[i]:WaitForChild("Settings"):WaitForChild("HG").Value = true if HGS.HG1.Toggle.Value == false then HGS.HG1.Toggle.Value = true HGS.HG1.Avatar.Value = AllPlayers[i].UserId HGS.HG1.Player.Value = AllPlayers[i].Name elseif HGS.HG1.Toggle.Value == true then HGS.HG2.Toggle.Value = true HGS.HG2.Avatar.Value = AllPlayers[i].UserId HGS.HG2.Player.Value = AllPlayers[i].Name