Hello all! So I have this leaderboard script but it doesn't update the rank when a player got a new rank and (re)joined the game. How can I make it so it updates the rank when a player got a new rank inside the group?
Script:
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("IntValue")
leaderstats.Name = "leaderstats"
leaderstats.Value = 0
local rank = Instance.new("StringValue")
rank.Name = "Rank"
if player:IsInGroup(3200799) then
rank.Value = player:GetRoleInGroup(3200799)
else
rank.Value = "Guest"
end
leaderstats.Parent = player
rank.Parent = leaderstats
end)
Thanks in advance.

5 comments
Um where do I put my groupID lol
You dont... you put your group name where it says group. I linked you to the wiki on how to use GetGroupAsync too...
Well, you could've been more clear. But thanks anyways.
What do you mean be more clear? I linked you a wiki link, showed you examples, and explained it lol. How can that be more clear?
I meant the v.Name == "Group" maybe you could've add a --put the name of the group here. But it's ok..