RoScripter

Group Rank Template

May 12th, 2020 (edited)
39,311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. /*INSERT GROUP ID AND COOKIE BELOW*/
  2.  
  3. var groupId = 12345 // << Replace 12345 with your Group Id
  4. var cookie = "" // << Put your account cookie inside of the quotes
  5.  
  6. /*INSERT GROUP ID AND COOKIE ABOVE*/
  7.  
  8.  
  9. const express = require("express");
  10. const rbx = require("noblox.js");
  11. const app = express();
  12.  
  13. app.use(express.static("public"));
  14.  
  15. async function startApp() {
  16.   await rbx.setCookie(cookie);
  17.   let currentUser = await rbx.getCurrentUser();
  18.   console.log(currentUser.UserName);
  19. }
  20. startApp();
  21.  
  22. app.get("/ranker", (req, res) => {
  23.     var User = req.param("userid");
  24.     var Rank = req.param("rank");
  25.  
  26.     rbx.setRank(groupId, parseInt(User), parseInt(Rank));
  27.     res.json("Ranked!");
  28. });
  29.  
  30. const listener = app.listen(process.env.PORT, () => {
  31.   console.log("Your app is listening on port " + listener.address().port);
  32. });
Add Comment
Please, Sign In to add comment