π BaseClass
BaseClass is the class from which all ClassLib classes inherits
πΏ Static Functions
GetAll
GetAllReturns all instances from this class
β Returns table (Table of all instances of the class)
local ret = BaseClass.GetAll()
for _, v in ipairs(ret) do
print(v:GetID())
endGetCount
GetCountReturns how many instances of this class exists
β Returns integer (Amount of instances of the class)
GetByID
GetByIDReturns an instance of this class from the instance unique ID
β Returns table (The instance, or nil if it doesn't exist)
GetParentClass
GetParentClassReturns the class from which this class inherits
β Returns table (The super class)
GetAllParentClasses
GetAllParentClassesReturns a sequential table of all classes from which this class inherits
β Returns table (The super classes)
GetInheritedClasses
GetInheritedClassesReturns a sequential table of all classes that inherit from this class
β Returns table (The inherited classes)
Inherit
InheritCreates a new class that inherits from this class
β Returns table (The new class)
ClassCall
ClassCallCalls an event on the class
ClassSubscribe
ClassSubscribeSubscribes to an Event on the Class
β Returns function (The callback)
ClassUnsubscribe
ClassUnsubscribeUnsubscribes from all subscribed Events on this Class, optionally passing the function to unsubscribe only that callback
SubscribeRemote
SubscribeRemoteSubscribes to a remote event
UnsubscribeRemote
UnsubscribeRemoteUnubscribes to a remote event
π¦ Methods
Constructor
ConstructorCalled after an instance of the class is created
Destructor
DestructorCalled when an instance is about to be destroyed
SetValue
Sets a key/value on the instance
GetValue
Gets a key/value from the instance
GetAllValuesKeys
Returns all the values of the instance set by SetValue
IsValueBroadcasted
Returns wether a key has it's value is broadcasted
β Returns boolean
Call
CallCalls an Event on the instance
Subscribe
SubscribeSubscribes to an Event on the instance
β Returns function (The callback)
Unsubscribe
UnsubscribeUnsubscribes from all subscribed Events in this instance, optionally passing the function to unsubscribe only that callback
CallRemote
CallRemoteCalls a remote event, from the client to the server, or from the server to the client
BroadcastRemote
BroadcastRemoteBroadcast a remote event from the server to all clients
Clone
CloneClones the instance, and return the new clone with the same values (except it's ID)
Optionally, you can ignore some properties, so they won't be copied
β Returns table (The new instance)
Destroy
DestroyDestroys the instance
GetClass
GetClassReturns the class table of the instance
β Returns table
GetClassName
GetClassNameReturns the class name of the instance
β Returns string (The class name)
GetID
GetIDReturns the ID of the instance
β Returns integer (Amount of instances of the class)
IsA
Checks if the instance is from a passed class, or from a class that inherits from the passed class
β Returns boolean
IsValid
IsValidChecks if the instance is valid
β Returns boolean (Wether the instance is valid)
IsBeingDestroyed
IsBeingDestroyedChecks if the instance is being destroyed
β Returns boolean (Wether the instance is being destroyed)
Super
SuperReturns the class from which this instance class inherits
β Returns table (The parent class)
SuperAll
SuperAllReturns a sequential table of all classes from which this instance inherits
β Returns table (The list of parent classes)
π Events
ClassRegister
ClassRegisterCalled when a new class is inherited from this class
Spawn
SpawnTriggered when an instance is created
Destroy
DestroyTriggered when an instance is about to be destroyed
ValueChange
ValueChangeTriggered when an instance has a value changed with :SetValue()
Last updated
Was this helpful?
