Hi,
I have this function that adds +1 win to the player, but it doesnt appear to work… Is there anything wrong here? It runs once it there is 1 player left in the table.
local function getWinnerName()
if activePlayers[1] then
local player = Players:GetPlayerFromCharacter(activePlayers[1])
if player then
local leaderstat = player.leaderstats
local wins = leaderstat:FindFirstChild('Wins')
wins.Value += 1
else
print('player not found')
end
return activePlayers[1].Name
else
return 'Player Disconnected'
end
end