Hey! Today I will be showing you how you can make your own personal group ranking bot!
Step 1:
Make the account you want to use as your bot. Add that bot to the group you want to rank people in. Give the bot account permissions so they can rank people.
Step 2:
Go to glitch.com. This is a free website where we will do some of the coding and hosting. It should look something like this:
Log in however you want. (GitHub, Google, etc.) Then at the top right press new project.
In the server.js file:
delete everything and paste in this code
/*INSERT GROUP ID AND COOKIE BELOW*/
var groupId = 12345 // << Replace 12345 with your Group Id
var cookie = "" // << Put your account cookie/.ROBLOSECURITY key inside of the quotes
/*INSERT GROUP ID AND COOKIE ABOVE*/
const express = require("express");
const rbx = require("noblox.js");
const app = express();
app.use(express.static("public"));
async function startApp() {
await rbx.setCookie(cookie);
let currentUser = await rbx.getCurrentUser();
console.log(currentUser.UserName);
}
startApp();
app.get("/ranker", (req, res) => {
var User = req.param("userid");
var Rank = req.param("rank");
rbx.setRank(groupId, parseInt(User), parseInt(Rank));
res.json("Ranked!");
});
const listener = app.listen(process.env.PORT, () => {
console.log("Your app is listening on port " + listener.address().port);
});
Next, go to the package.json file right above the server.js file
Click add package and type in “noblox.js”, and click on the first one.
Make sure you delete the src file and all it’s contents.
Now, click preview, then preview in a new window
It should open a pretty much blank webpage with an error code. Just ignore this. The only thing we need is to copy the url at the top.
Step 3:
Now, load up Roblox Studio. Make sure your game has HTTP Requests enabled. Make a script in ServerScriptStorage with the following code:
local GlitchURL = "" --Place the glitch project URL we copied inside of the quotes
function rankUser(UserId, RoleId)
game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=" .. UserId .. "&rank=" .. RoleId)
end
local UserId = 12345 --Replace 12345 with the users userid
local RoleId = 255 --Replace 255 with the role id that you would like the user to be set to
rankUser(UserId, RoleId)
Now all you have to do is test like you normally would in Studio and it should work
Note: The rank bot must be a higher rank than the rank you want to set the user to.
Thanks for reading and I hope this helped!