game.Players.PlayerAdded:connect(function(Player) wait(1) local stats = Instance.new("IntValue") stats.Name = "leaderstats" stats.Value = 0 local Rank = Instance.new("StringValue") Rank.Name = "Rank" Rank.Value = Player:GetRoleInGroup(4731512) else if Player:GetRoleInGroup(4731512) == 0 then Rank.Value = "Customer" end Rank.Parent = stats stats.Parent = Player end)
You can use the player's IsInGroup() function
if(not Player:IsInGroup(4731512))then Rank.Value = "Customer" end
Remove else and did you mean GetRankInGroup? GetRoleInGroup returns a string.
local function PlayerAdded(Player) local stats = Instance.new("IntValue") stats.Name = "leaderstats" stats.Value = 0 local Rank = Instance.new("StringValue") Rank.Name = "Rank" Rank.Value = Player:IsInGroup(4731512) and 'Customer' or 'Guest' Rank.Parent = stats stats.Parent = Player end game.Players.PlayerAdded:Connect(function(Player) PlayerAdded(Player) end) for _, Player in pairs (game.Players:GetPlayers()) do PlayerAdded(Player) end