By editing this table inside the module, you can make classes inherit properties and methods from other classes
Creating Presets/Classes:
In this module, presets are the equivalent to roblox object classes (eg: Humanoid, BodyGyro and …), to create new ones all you have to do is go inside the module and find a folder called “Presets”
Ive already left 2 presets in there so you can duplicate those and adjust them to your needs
-- Server --
local newClass = CustomInstance.new("Car") -- This is a custom class
newClass.Speed = 100
newClass.Name = "NewCar"
newClass.Parent = workspace
task.wait(5)
newClass.Speed = 50
-- Client --
local object = workspace:WaitForChild("NewCar")
local newClass = CustomInstance.get(object)
print(newClass.Speed)
newClass:GetPropertyChangedSignal("Speed"):Connect(function(old, new)
print(old, new)
end)
5 seconds after the game starts (ignore the third one):
local started = os.clock()
workspace:SetAttribute("Something", 10)
print(os.clock()-started)
local CI = require(ReplicatedStorage.CustomInstance)
local class = CI.new(workspace)
local started = os.clock()
class.Something = 10
print(os.clock()-started)
its gonna get more optimized with the update that is gonna come out in the next 2-3 hours
well CustomInstance gives you a GetPropertyChanged signal and server->client replication so no you cant just use a dictionary if you want these features.
BridgeNet2 Support (better server->client replication)
2x slower than previous version, had to sacrifice a tiny bit of performance for better workflow but if you care about performance you can still get v0.5 from github’s releases page
I didnt do a lot of testings on this version so if lmk if you find any bugs