So I am trying to make a bot for my upcoming cafe group that ranks players. Here is the code in game
local GlitchURL = "not included for obvious reasons"
function rankUser(UserId, RoleId)
game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=" .. UserId .. "&rank=" .. RoleId)
end
local UserId = 246908413
local RoleId = 3
rankUser(UserId, RoleId)
The userId is a random one I found from my group, and this is the code in the glitch project
var groupId = 6661045
var cookie = "again, not included for obvious reasons"
const express = require("express");
const rbx = require("noblox.js");
const app = express();
app.use(express.static("public"));
async function startApp() {
await rbx.cookieLogin(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);
});
Whenever I go to the correct url it works fine, ranks the correct user and everything, but when I try to do it from studio, it doesn’t work (I do have http requests on)
I don’t know if this has anything to do with it, but when I go to the url it says waking up project and takes a while but when it’s up then it works fine. Does anyone know how to fix this?