So, for my game, I started working on the elimination system, however I'm getting an error I can't seem to find an answer to. Any help?
Also, the output error is at the bottom.
local playingList = game.Teams.Playing:GetPlayers()
playerTable = {
}
for i, v in pairs(playingList) do
table.insert(playerTable, playingList[i].Name)
print(playingList[i].Name)
end
local smallestValue = math.huge
local smallestPlayer = nil
for i, v in pairs(playerTable) do
currentPlayer = v
if game.Players.currentPlayer.PlayerGui.ScreenGui.ProgressBar.Config.Value < smallestValue then
smallestPlayer = game.Players.currentPlayer
smallestValue = game.Players.currentPlayer.PlayerGui.ScreenGui.ProgressBar.Config.Value
print(smallestValue)
end
end
Output error:
00:09:20.311 - currentPlayer is not a valid member of Players

3 comments
i = number, v = object. So, it should be v.Name, if you're trying to put the name of the player in the table.
I'll try this. Thanks!
Same output. I also made a little edit at the top if you wanna take a look.