Rex Framework | Designed for beginners to intermediate developers

The plugin seems like an overkill. The framework is one object that you put into replicated storage and it’s done! No need to hog your plugin space with something that inserts one object. If it required multiple objects in multiple services or places I’d consider because it may be harder to setup. I update the model regularly so worry not. If you start a new project it’ll most likely be updated.


I do want to re-iterate something since I am replying; I’m currently using this framework for game production as a experiment. This experiment will help me figure out what features are useful, what features need to be removed and what features do I need to improve the framework.

I also want to mention that when I was constructing this framework, the ideal goal was to be able to stick on the server as much as possible. As I’ve tested the framework I’ve noticed one issue that may or may not be problematic.

  1. GetService, GetDatabase, GetClass

I’ve noticed that creating services, databases and classes at run time can be fairly problematic. The reason for it being problematic is because within your class or service you may want to have reference to another class or service and utilize that. The first solution to this issue is to do GetService, GetDatabase and GetClass within the function like so:

local ControlsHandler = Rex:CreateClass("ControlsHandler", {}, {
	Sprint = function(Player)
        local StatesDatabase = Rex:GetDatabase("States") -- You'll notice I did it in here
		local Character = Player.Character
		local Humanoid = Character and Character.PrimaryPart and Character:FindFirstChild"Humanoid"
		if Humanoid then
			StatesDatabase[Player.Name].Sprinting = not StatesDatabase[Player.Name].Sprinting
			Humanoid.WalkSpeed = (StatesDatabase[Player.Name].Sprinting and 24 or 16)
			Rex:ReplicateDatabase()
		end
	end,
}) 

Now this can get really annoying having to do that within every function. GetService, GetDatabase and GetClass are methods that will yield until Rex:Start() is called.

The other solution is the use of metatables. If I were to require a module and it had Rex:GetService() at the top, it’ll yield and result in a infinite yield. The solution is to not require all the modules and cache them at once, rather cache them and require them when you need them. Chances are the functions won’t be called at runtime.

local StandAbilities = {}

for _, Stand in ipairs(ServerStorage["Stand Abilties"]:GetChildren()) do
	StandAbilities[Stand.Name] = {}
	setmetatable(StandAbilities[Stand.Name], {
		__index = function(ot, index)
			ot[index] = require(Stand[index])
			return ot[index]
		end
	})
end

These issues I’ve considered as minor for the time being. If I can come up with a solution to make it even easier I will do so. At the moment, I’m looking at prebuilt services to help people stick on the server. I’m considering: SoundService, and ParticleService (you’ll notice most of these are special effects related that should be done on the client which is why I did AnimateService).

EDIT: There was an issue previously with :GetService, :GetClass, :GetDatabase. Where it would yield even though it already existed (was prebuilt). I’ve fixed this in a newer version of the Rex framework allowing you to call those functions before Rex:Start().

I understand
It could be nice as a option tho.

Looking forward to more updates on this framework!

1 Like

I submitted a pull request in the repo for some changes I think would streamline the module.

I took a look and when making the framework I did have that in mind. The thing is I want to keep my habits more towards Lua.

I’ll go ahead and remove the localisation.

EDIT: To anyone notified by this, after working with the framework I haven’t found any major issues. I’ll continue using the framework and experimenting. I’ve also added another service and the post will be updated.

Just a heads up, it is generally more polite to merge pull requests that you want to implement into your project rather than closing the pull request and then commiting the changes under your name.

Very sorry, this is my first time using GitHub with pull requests (I’m still not sure what they are exactly). I hope I did not offend you in anyway.


Update: 2020-10-30T04:00:00Z

After working with the framework for a while, it’s serving its attended purpose keeping most of the scripting on the Server. I’ve updated the post by re-formatting it and fixing a few grammar mistakes. I’ve also included documentation on HitboxService which can be actively used for AOE or Projectile Based special abilities and skills.


Update: 2020-11-01T04:00:00Z

Over the duration of me working front end (skills, magic, abilities), I’ve decided to introduce VFXService. VFXService has 2 main functions as of right now, :Shake() and :Blur(). This is to again help users stay server sided. The :Shake() function uses Crazyman’s Camera shake.

To use:

local VFXService = Rex:GetService("VFXService")

VFXService:Shake(ShakePreset, TargetPlayer)
VFXService:Blur(TotalDuration, BlurSize, TargetPlayer)

If TargetPlayer is nil, it will affect every single player.

Here’s what I made using these functions:


Update: 2020-11-07T05:00:00Z

Updates

  • Improved HitboxService :CastProjectileHitbox() function for more accurate for progressive raycasts.
  • Fixed minor bugs with AnimateService
    Here’s a gif using a combination of AnimateService and the HitboxService:

https://gyazo.com/b624266855b141891cd421a330f18371


Update: 2020-11-10T05:00:00Z

Updates

  • Fixed a bug with replication for AnimateService

After using AnimateService frequently, I’ve noticed a bug which was with the auto replication. Here’s a visualization of the unfixed version vs the fixed version:

Here’s the code:

local Rex = require(game.ReplicatedStorage.Rex)
wait(5)
local AnimateService = Rex:GetService("AnimateService")

local Tween1 = AnimateService:Create({
	{script.Parent, 10, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0, {Transparency = 1}}
})
Tween1:Play()
print("YESR")
wait(6)
local Tween1 = AnimateService:Create({
	{script.Parent, 2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0, {Transparency = 0}}
})
Tween1:Play()
print("YO WHAT ISS UP DUDE")
wait(4)
print("THIS FINSIHED BBRO")

As you can see the first one is the unfixed version, this is because previously, replication was based on time of the tween. You can see that 6 seconds into the first tween, I re-tween the same property, however, the replication takes priority in the first tween due to length of the tween.

The second part of the video shows wanted behavior in Roblox’s normal TweenService. Even though it’s the same code, the second one takes replication priority simply because it overlaps the first one.

The model has been updated to the date above, no forms of methods or functions were changed, just an internal fix on the TweenService wrapper.


Update: 2020-11-15T05:00:00Z

Updates

  • Added ClientService
  • Added Automatic Clean Up To AnimateService (You no longer need :Destroy())
  • Added :PauseAllAnimations() and :PlayAllAnimations() to AnimateService
  • Added DebrisService
  • Update Documentations

Update: 2020-11-16T05:00:00Z

Updates

  • Fixed caching issue with AnimateService, :PauseAllAnimations() and :PlayAllAnimations() should function properly now
  • Added the ability to reuse tweens even after they are dead, this will internally create a new tween with the same data
  • Added VFXService:FOV() to have an animated FOV effect

Example Of Using New Updates:

Hey, I see this framework is outdated. Is it still usable?

Hey there. there only thing outdated is the documentation, the framework has been updated for it to be simplified and for it to have more useful functionality.


I will update the documentation right now and let you know when it’s up to date.

1 Like

Thanks! I am going to use it for my game.

The post has been updated, I’ve also provided a place example under “Example Use Case”. I was unable to add every single function and module as it was too overwhelming, I’m sure everyone can find a use case for the other modules.


The module will still be actively updated. I will update the documentation and needed. Feel free to let me know if you need any form of help whatsoever. You can also let me know if you want to know if there are any specific modules for your use case.

1 Like

this is sooooooooooooooooooooooooooooo awesome and useful aaaaaaaaaaaah u just saved me 4 months of scripting tbh too good but uuh might i reccommend changing the names of funcs around a lil bit like changing the vfx to camerafx cuz it is a lil bit confusing with some things

That’s great to hear, you’re more than free to change the function names yourself but it may break certain functions if it relies on it.


In general, the framework is still being worked on and is being tested with live production. There are a few optimization updates thanks to @Prexxo .

1 Like

by any chance u didnt mean to say client cant write to the table but can read from it right?

got 2 questions-
a) can i write/read via server
b) can i put a function in the database and call it??

That is a typo yes, client can read but can’t write to it but the server can edit it as you please. If you create a database on the client however the server will not have access to it.

If you were to create a database on the client you could do that however on the server I’d recommend using :CreateModule() and :GetModule()

1 Like

You should add libraries like Maid,Array,Spring, Table,Signal . They are useful libraries.

[UPDATE | 2021-08-16 11:22PM]:

General
  • Updated Source Code to utilise task
Databases
  • Deprecated Databases (please use SetAttribute and or Instances)
Built-In Services
  • Removed VFXService Blur Function | (ACTION REQUIRED IF USED)
  • Removed VFXService Slash Module | (ACTION REQUIRED IF USED)
  • Deprecated VFXService FOV Function
  • Deprecated TaskScheduler (now uses task internally, no changes required)
  • Deprecated LerpService (Please use TweenService instead)
  • Updated DebrisService (Now uses task, no action required)
  • Updated VFXService (Sound Functions)
  • Added MarketService
Functions
  • Removed wait function (please use task.wait, ACTION REQUIRED)
  • Added Weld Function
  • Removed Random Function

Question does this Framework still work?? because most things I have tried and they don’t work at all

Hey, feel free to PM me on DevForum and I can help you out. What exactly doesn’t work?

1 Like

Thank you! but I have figured it out, it was a mistake on my end I read the documentation wrong and missed up a few lines. Great Framework btw

1 Like