sorry if i sound rude but dude what are you trying to do?
you can rank somebody from the roblox website. if you want to do that from somewhere else (a discord bot, your website, inside of a roblox game) youre going to have to send a request with the groups api
You can just use groups to do this but if you want a custom system I suggest doing something like this:
local DatastoreService = game:GetService("DataStoreService")
local rankDatastore = DatastoreService:GetDataStore("RankDataStore")
local Roles = {
["Owner"] = {rank = 1, userIds = {user ids here}},
["Admin"] = {rank = 2, userIds = {same thing}},
}
local success
local attempts = 0
local maxAttempts = 5
while not success and attempts < maxAttempts do
attempts += 1
success, err = pcall(function()
rankDatastore:SetAsync("Roles", Roles)
end)
if not success then
warn("Failed: " .. err)
task.wait(2)
end
end
To retrieve the data you can use :GetAsync(“Roles”) which will return the table with all the roles and user ids assigned to it.
If you understand Python, you can use PythonAnywhere to host your bot.
It’s my go-to when I want to take advantage of other platforms’ APIs, and it’s completely free.
Ah sorry for the previous reply, you can use Player:IsInGroup(GroupId) to check if a player is in a group first, you can then use Player:GetRankInGroup(GroupID) or Player:GetRoleInGroup(GroupdID) depending on your needs. However since you are using a bot you will have to set up a host server and HTTP request to roblox’s Groups API