Giter Club home page Giter Club logo

noblox.js-server's Introduction

noblox.js-server

ROBLOX API Discord

This is an improved example server that uses the noblox.js library, allowing users to execute site actions from in-game via HttpService.

Instructions

  • Go to config.json and set user_cookie to the .ROBLOSECURITY cookie of the account you want to use.
  • The auth_key field is essentially a password for the site (to prevent strangers from accessing account functions). I recommend generating a random string or just smashing your keyboard since this will typically be accessed by a script from Roblox.
  • There is also an optional setting maximum_rank which can be used to prevent attacks. User's above this rank are immune from having their rank changed and attempts to change a user's rank to something above this will be rejected.

NOTE: If you choose to use Hosting such as glitch.me for this server, it is highly recommended you move the config.json variables into a .env file for added security. (Note that if you do this you must update the .js files to point to process.env as the new configs file. i.e. config.auth_key will become process.env.auth_key

Lua Example

A script is available in Main.lua that allows you to use functions to send commands to the server. The ModuleScript Server.mod.lua contains the functions to send a HttpRequest to the server. It being a ModuleScript allows easy access to call the functions from any server-sided Script in your game. The ModuleScript Configs.mod.lua contains the configuration variables required to send the requests. This has a field to enter your secret auth_key from above, and also for the BaseUrl of your server.

The functionspromote, demote, setRank, shout, handleJoinRequest from the library are available, all arguments are in the same order as they are in the documentation. Arguments are passed in the Body as JSON.

Example usage, assuming the following setup in your game:

The Script Main is a Script in ServerScriptService. The ModuleScript Server.mod.lua is a ModuleScript called Server as a Child of Main The ModuleScript Configs.mod.lua is a ModuleScript called Configs as a Child of Main

local Server =  require(script.Server)

-- EXAMPLE USAGE

Server.Promote(GroupIdHere, PlayerUserIdHere)
Server.Demote(GroupIdHere, PlayerUserIdHere)
Server.SetRank(GroupIdHere, PlayerUserIdHere, RankIdHere)

Server.HandleJoinRequest(GroupIdHere, "PlayerUsernameHere", true) -- Accept the request
Server.HandleJoinRequest(GroupIdHere, "PlayerUsernameHere", false) -- Decline the request
Server.GroupShout(GroupIdHere, "MessageToShoutHere")

noblox.js-server's People

Contributors

hamzah-z avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.