So I want to make my friend's group a leaderboard that shows the person's division, i.e. another group, and then the rank of that group. I have this script, but when I start I see the leaderstats on the leaderboard but they do not fill in. I am in the first group on the list and it is still empty. It's in a regular script placed in ServerScriptService.
game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("IntValue")
leaderstats.Name = "leaderstats"
leaderstats.Value = 0
leaderstats.Parent = player
local allegiance = Instance.new("StringValue")
allegiance.Name = "Allegiance"
allegiance.Value = "None"
allegiance.Parent = leaderstats
local rank = Instance.new("StringValue")
rank.Name = "Rank"
rank.Value = "None"
rank.Parent = leaderstats
--v----DDR/Divisions
if player:IsInGroup(3120627) then allegiance.Value = "DDR Volk." rank.Value = player:GetRoleInGroup(3120627)
elseif player:IsInGroup(2536151) then allegiance.Value = "DDR Grenz." rank.Value = player:GetRoleInGroup(2536151)
--v----SAF/Divisions
elseif player:IsInGroup(2971335) then allegiance.Value = "SAF" rank.Value = player:GetRoleInGroup(2971335)
elseif player:IsInGroup(3294006) then allegiance.Value = "SAF Airborne" rank.Value = player:GetRoleInGroup(3294006)
elseif player:IsInGroup(3279476) then allegiance.Value = "SAF Airforce" rank.Value = player:GetRoleInGroup(3279476)
elseif player:IsInGroup(3279454) then allegiance.Value = "SAF KGB" rank.Value = player:GetRoleInGroup(3279454)
elseif player:IsInGroup(3120627) then allegiance.Value = "SAF Armor" rank.Value = player:GetRoleInGroup(3120627) end
leaderstats.Parent = player
end)

1 comment
Please fix your code block.