Hyra’s Ranking API comes with a Roblox MainModule wrapper to allow you to easily interact with the API from Roblox Lua.

Getting started

Make sure you have your API key and Workspace ID to hand.

You can find your Workspace ID in the URL of your workspace. For example, if your workspace URL is https://app.hyra.io/123456, your Workspace ID is 123456.

Your API key can be found in the Workspace Settings under Developer API.

Require the Module

At the top of the Server Script where you want to use Ranking, you must require the module.

local ranking = require(14743387756)
local workspaceId = "abc123" -- Your Workspace ID

Ranking a user

In your event or function, you can rank a user by calling the SetRank function.

local callback = ranking.SetRank(token, workspaceId, userId, groupId, rank)

if callback.success then
-- Ranked successfully
else
-- Handle failure
print(callback.message)
end

The API is callback based, so you can react to success or errors by checking the success boolean in the callback.