So Im making a spectating gui, and when I do :GetPlayers() for each client they are the first in the table, so player2 is first in there table. Is there a way to eliminate this?
script.Parent.Front.Activated:Connect(function()
local AllPlayers = game.Players:GetPlayers()
print("first player really is ".. AllPlayers[1].Name)
local MaxIndex = #AllPlayers
local CurrentIndex = GetCurrentPlayerIndex()
if CurrentIndex + 1 <= MaxIndex then
Camera.CameraSubject = AllPlayers[CurrentIndex + 1].Character.Humanoid
print("The next player is ".. tostring(GetCurrentPlayer()))
else
Camera.CameraSubject = AllPlayers[1].Character.Humanoid
print("The camera has been reset to first player, who is ".. tostring(GetCurrentPlayer()))
end
NameShower.Text = GetCurrentPlayer().Name
end)