I made a script that changes someone's team if they are in a group and resets them so that they spawn in the right place but it adds a wipeout to their leaderboard. How do I access the leaderboard and subtract 1 in the function after i reset them?
You do not access the leaderboard, you create the leaderboard.
Leaderboards are made by creating an IntValue
named "leaderstats" inside of the player, then inserting all other stats, such as NumberValues for Kills and Deaths inside of the leaderstats.
You can figure that out yourself. As to changing the Deaths when the Player dies, you can use the .Died
event.
function humanoidDied(humanoid) local player = game.Players:GetPlayerFromCharacter(humanoid.Parent) if player ~= nil then player.Deaths.Value = player.Deaths.Value - 1 end end for i,v in pairs(game.Players:GetChildren()) do --Fires the humanoidDied function for each player v.Character.Humanoid.Died:connect(humanoidDied) end