j8cksxn
(j8cksxn)
August 8, 2019, 3:04pm
#1
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
starmaq
(starmaq)
August 8, 2019, 3:15pm
#3
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
j8cksxn
(j8cksxn)
August 8, 2019, 3:23pm
#4
Thank you so much for your help!
starmaq
(starmaq)
August 8, 2019, 5:27pm
#5
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
j8cksxn
(j8cksxn)
August 8, 2019, 5:35pm
#7
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