RB_Modules 1.0.0

Greetings!,
So, RB_Modules is finally out! But, what are the RB_Modules???

-ABOUT

The RB_Modules is an open-sourced library containing 3 unique and easy-to-use modules (with more coming soon!). We started developing these modules on the 2nd of July 2021, with a goal of reaching a usable state by the end of the month, where users would be able to include these modules in their workflow, without needing to worry about the technical stuff. The three modules which are now supported are:

TimeService - 12 separate functions concerning Time queries.
CryptoService - 5 separate functions returning hashed or encrypted values.
BasicMovesService - A module with in-depth configuration, which adds moves binded to keys (such as
double jump)

-Who is this for

Literally everyone! These modules were created to be compatible across all devices (except for the Basic Moves Service which is pc exclusive) and be both server and client sided.

-Oh, that’s cool. How do I get this?

Along with these modules we created a plugin to deliver them. It is called the RB_Modules Plugin (RB_Modules Plugin - Roblox). It works by storing the modules and cloning them into the replicated storage when they are requested. However, for this to work, you will need to allow script injection (Studio<Plugins<ManagePlugins<RB_Modules Plugin and configure the permissions). Through this plugin, you can install, remove and get info about the RB_Modules.

-Documentation

To request any module, you will need to require the library module script, which is effectively the manager of the rest. To do so you would write:

local Library = require(game.ReplicatedStorage.RB_Modules.Library) -- Request the Library module, which is the "manager" of all the others.
  • TimeService:

This RB_Module contains methods for time queries. It is an easier alternative for ‘tick()’, which is currently used in Roblox coding and only returns the seconds passed since January 1st, 1970 (Unix Timestamp). It comes with several easy to use functions which return information on the current time. This module is both server and client sided, which means that you will have no compatabiliy issues with it.

To request the TimeService you will need to use the GetService() function from the Library. This means:

local TimeService = Library:GetService('TimeService') -- Request the specific module, in this case TimeService.

Now the next step is to call a function from this Service.

TimeService.callFunction() --The local name of the module and the name of the function (it's cAsE SEnsTtiVe!).

Here are all the functions of the TimeService:

TimeService.getYear() -- Returns the current year in an intiger.

TimeService.getDayOfYear() -- Returns the current day of year in an intiger

TimeService.getMonth() -- Returns the current month in an intiger.

TimeService.getDate() -- Returns the current date in an intiger.

TimeService.getHour() -- Returns the current hour in an intiger.

TimeService.getMinute() -- Returns the current minute in an intiger.

TimeService.getSecond() -- Returns the current second in an intiger.

TimeService.getMillisecond() --Returns the current millisecond in an intiger. 

TimeService.getWeek() -- Returns the current week in an intiger.

TimeService.getMonthName() -- Returns the name of the current month in a string.

TimeService.isAM() -- Returns true if the current time is before noon and false if it isn't.

TimeService.GetFullHour() -- Returns the full hour hour in a pretty format. ex: 03:49:35 PM

That’s all for ‘TimeService’ version ‘1.0.0’. Future versions will optimise the code, add new functionality and fix bugs.

  • CryptoService

This RB_Module contains methods for encrypting and hashing data. It comes with several easy to use functions which return the data encrypted, decrypted or hashed. This module is both server and client sided, which means that you will have no compatibility issues with it.

What’s the difference between encrypting and hashing?

Hashing: The process of encrypting a value in such a way, that it cannot be decrypted. A value will always return the same corresponding hash key.

Encryption: The process of encrypting a value in such a way, that it can be decrypted. A value will always return the same corresponding encryption, and this encryption will always return the origin value.

To request the CryptoService you will need to use the GetService() function from the Library. This means:

local CryptoService = Library:GetService('CryptoService') -- Request the specific module, in this case CryptoService.

Now the next step is to call a function from this Service.

CryptoService.callFunction() --The local name of the module and the name of the function (it's cAsE SEnsTtiVe!).

Here are all the functions of the CryptoService:

CryptoService.createHexHash(value, algorithm) -- Returns a hash encryption of the original value.  (ex: 356a192b7913b04c54574d18c28d46e6395428ab).
-- Params: 
--Value: The value that needs to be encrypted. Must be a string. If you want to hash a nubmer use: toString(int).
--Algorithm: For now, only the 'sha1' algorithm is supported. Leave this field empty, and it will automatically hash using 'sha1'.


CryptoService.createBinHash(value, algorithm) -- Returns a hash encryption of the original value, using more characters (ex: 5j+y�LTWMF�9T(� 20 ).
--Params:
--Value: The value that needs to be encrypted. Must be a string. If you want to hash a nubmer use: toString(int) .
--Algorithm: For now, only the 'sha1' algorithm is supported. Leave this field empty, and it will automatically hash using 'sha1'.


CryptoService.encrypt(value, method) -- Returns an encrypted version of the original value, which contains the same amount of characters.
--Params: 
--Value: The value that needs to be encrypted. Can be a string or an int. 
--Method: For now, only the 'encha' method is supported. Leave this field empty, and it will automatically encrypt using 'encha'.


CryptoService.decrypt(value, method) -- Returns a decrypted version of the original value.
--Params:
--Value: The value that needs to be decrypted. Can be a string or an int.
--Method: For now, only the 'encha' method is supported. Leave this field empty, and it will automatically dencrypt using 'encha'.
--Warning! If the encrypted value isn't encrypted using encha, the result will be incorrect! 


CryptoService.random(value) -- Returns an encrypted value which cannot be decrypted. Every time you run this function, the result will be different.
--Params:
--Value: The value that needs to be randomly encrypted. Can be a string or an int. 

That’s all for ‘CryptoService’ version ‘1.0.0’. Future versions will optimise the code, add new functionality, fix bugs and of course add new methods and algorithms.

  • BasicMovesService

Now this Service is a bit different. You won’t need to request it in a script.

This RB_Module contains methods altering a character’s speed. It comes with several easy to use configurations which change the value of the speed needed. There is a full configuration (in the configuration folder). This module is only client sided, but it does not return any usable functions, which means that there will be no compatibility issues with it. Be careful! This module only works for pc and is still a prototype!

To import this module you will need to call the following command on the ‘Command Bar’(View<Command Bar):

require(game.ReplicatedStorage.RB_Modules.Library):BasicMoves()

This should add a new script inside the StarterCharacterScripts.
To enable it you will need to go to ReplicatedStorage.RB_Modules.BasicMovesService.Configuration.Enabled.Value and set it to true.

Here are the parameters of the configuration:

local Config = game:GetService("ReplicatedStorage").RB_Modules.BasicMovesService.Configuration.Enabled

	Config.Sprint = true -- Sets the speed to Config.Sprint.Speed while the Config.Sprint.Key is pressed

	Config.Crouch = true -- Sets the speed to Config.Crouch.Speed while the Config.Crouch.Key is pressed

	Config.Stealth = true -- Sets the speed to Config.Stealth.Speed while the Config.Stealth.Key is pressed

	Config.WalkSpeed = 16 -- Sets the default speed which is used when a move key is released

	Config.DJump = true --Enables the double jump function. Config.DJump.TimeBetweenJumps sets a minimum waiting time before the second jump. Config.DJump.JumpMultiplier sets a multiplier for the second jump. 

That’s all for ‘BasicMovesService’ version ‘1.0.0’. Future versions will optimise the code, add new functionality, fix bugs and of course add animation support.


-How can I support this project?

If you like what we do, leaving a comment and a like on this post (www.devforum.roblox.com/) would be very appreciated. You can also donate by buying this shirt (RB_Modules Donator - Roblox) to assure RB_Modules’ future development, however, don’t feel obligated to do so.

-Can I be part of this project? (Contributing)

Absolutely yes! We would love to see your additions to this project. Perhaps it is a new module, a new function on an already existing one or simply a spelling/grammar mistake. Everything counts. To contribute you can write a comment here with your contribution, send me a pm (I would prefer this) or a dm on discord (gchainis#0100).

Thanks for reading this post!!
If you have any questions feel free to comment them down below, and I will answer as soon as possible!
-gchainis :upside_down_face:

12 Likes