Overhead Rank Script Error

I’m trying to make a rainbow rank gamepass but also make it so certain ranks in a group can as well and there is an error involved and I don’t know what it means?

local Utility = script:WaitForChild(“Utility”)
local DataStore2 = require(Utility:WaitForChild(“DataStore2”))
local DataStoreService = game:GetService(“DataStoreService”)
local ServerDataStore = DataStoreService:GetDataStore(“SDDred1r2”)
local cache ={}

function GetID(username)
local userID;
if cache[username] then return true, cache[username] end
local s, e = pcall(function()
userID = game.Players:GetUserIdFromNameAsync(username)
end)
if s then
cache[username] = userID
end
return s, userID
end

function GetGroupsAsync(Player)
local UserId = (typeof(Player) == “Instance” and Player:IsA(“Player”)) and Player.UserId or typeof(Player) == “number” and Player
local Success, Groups = pcall(game:GetService(“GroupService”).GetGroupsAsync, game:GetService(“GroupService”), UserId)
return Success and Groups or { }
end

function GetRoleInGroupAsync(Player)
local Groups = GetGroupsAsync(Player)
for Index = 1, #Groups do
local Group = Groups[Index]
if Group.Id == 6201590 then
return Group.Role
end
end
return “Guest”
end

function GetRankInGroupAsync(Player)
local Groups = GetGroupsAsync(Player)
for Index = 1, #Groups do
local Group = Groups[Index]
if Group.Id == 6201590 then
return Group.Rank
end
end
return 0
end

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
repeat wait() until char
local head = char:WaitForChild(“Head”)
local rank = Utility:WaitForChild(“Rank”):Clone()
rank.Parent = head
rank:WaitForChild(“Frame”):WaitForChild(“Name1”).Text = player.Name
rank:WaitForChild(“Frame”):WaitForChild(“TextLabel”).Text = GetRoleInGroupAsync(player)
if game:GetService(“MarketplaceService”):UserOwnsGamePassAsync(player.UserId, 12766781) or GetRankInGroupAsync(player) >= 180 then
coroutine.wrap(function()
while true do
for i=1, 360 do
rank:WaitForChild(“Frame”):WaitForChild(“Name1”).TextColor3 = Color3.fromHSV(i/360, 1, 1)
wait()
end
end
end)()
end
end)
end)

Can anyone tell me what “attempt to compare string and number”?

“Attempt to compare string and number” means you tried to compare text to a number (i.e. “free” >= 5)

Configuration.RankID is supposedly a string and not a number

What does the “Configuration” table look like

Add tonumber(GetRankInGroupAsync(Player)) >= Configuration.RankID instead since the number might be a string value

1 Like

Please read category guidelines before posting.

It’ll be easier for us to help you