Hey, MrKirdid here!
I’m proudly announcing a framework especialliced for variables!
This framework allows:
Global Variables (Variables across multiple scripts)
Detecting Variable Change (link functions to when a variable is changed)
This is a WIP, however i started today, and I’m already out of ideas!!
So any suggestions would be great! I’d be happy to provide some updates to this!
This is of course a free framework, and all licenses are granted, you can do anything you want with it!
Theres a “Read Me” in the framework, but in case you don’t want to bother checking (i wouldn’t either )
Heres a short explenation/usage/showcase!
------- REQUIRE MODULE ------
local VarsPlus = require('path')
------- CREATE VALUE -------
local Coins = VarsPlus.Variable()
// Do VarsPlus.Variable("Coins") if you want a Global Variable
-------- SET VALUE -------
Coins:SetValue(100)
------- DETECT VALUE CHANGE -------
Coins:ConnectToUpdate(function(_OldValue, _NewValue)
end)
Coins:CTU(function(_OldValue, _NewValue)
end)
-------- GET VALUE ---------
local CurrentValue = Coins()
------- Get Global Value -------
Script1:
VarsPlus.Variable("CoinsVariable")
Script2:
VarsPlus.GetVariable("CoinsVariable")
Script communication isn’t really the main target here, the real reason i made this was pretty much souly to detect when varaibles were changed. But yeah you got a point, if you’re exclusively trying to do cross-script communication this’d be a bit overkill
A suggestion I have that might make this more useful is to allow server-to-client replication. So you can declare a variable on the server and use it on the client.