Hard Written By PunyAdmin1

Leaderboard Rank Created on: 01-01-2019

Put in ServerScriptService

local playerStats = {} --this keeps a list of the stats for each player that enters the game
 
 game.Players.PlayerAdded:connect(function(player)
     local leaderstats = Instance.new("Model", player)
     leaderstats.Name = "leaderstats"
 
     local grouprank = Instance.new("StringValue", leaderstats)
     grouprank.Name = "Rank"
	 local rank = player:GetRoleInGroup(4480202) -- Insert the group ID for whatever group you want ranks displayed for here. 
	
     if rank ~= 0 then -- Sets the rank that isnt in your group (Keep it 0)
		 grouprank.Value = rank
 	 else
		 grouprank.Value = "Guest" --  Names the rank of people not in your group (Ex: Guest)
	 end
 
     playerStats[player] = leaderstats 
 end)

Hard Written By PunyAdmin1

See PunyAdmin1's profile on Roblox

Discussion