[SUPPORT] How can I make a leaderboard auto refresh

Hi! I am fairly new to scripting, and I was wondering about how to do something.

How do I make my group rank leaderboard, refresh it’s stats when a player respawns.

For Example: When you promote someone in a group and you respawn them and it will show their NEW rank on the leaderboard.

Thank you,

P.S: If you need more of an example of what I mean please message me.

mxxnlxss

1 Like

For this you would use the .Died event of Humanoid, this event will fire whenever the Humanoid dies or in other words respawn, and have it so whenever it fires the group rank will update.
Also it is always best to include your attempt of doing this so we can help you fix it.

3 Likes

Thank you so much for your help!

No problem happy to help!

30 characters

An even better way would be to connect on CharacterAdded (An event of the player object).
This event fires whenever the player spawns.
https://developer.roblox.com/en-us/api-reference/event/Player/CharacterAdded

2 Likes

Hmm, never thought of that, I will try it! Thanks!

1 Like

maybe this will help you.

game.Players.PlayerAdded:connect(function(player)
local leaderstats = instance.new(“Model”)
leaderstats.name = “leaderstats”
leaderstats.Parent = player

local rank = instance.new(“StringValue”)
rank.Name = “Ranking”
rank.Value = game.Players.LocalPlayer:GetRoleInGroup(“Group Id”)
rank.Parent = leaderstats
end)

4 Likes