#Anyone know how to create a custom RBXsignal aka event?

4 messages · Page 1 of 1 (latest)

rich agate
#

you can make your own signals with classes like ```lua
local Methods = {}
Methods.__index = Methods

function Methods:Destroy()
if self.DestroyCallback then
self.DestroyCallback()
end
self.Object = nil
end

function Methods.Destroying(callback)
self.DestroyCallBack = Callback
end

function Methods.new(object)
local NewObject = setmetatable({}, Methods)

 NewObject.Object = object

 return NewObject

end


local Object = Methods.new(Part)

Object.Destroying(function()
print("Destroyed")
end)

Object:Destroy()

#

obviously remaking :Destroy() is useless but you get the idea

#

you can make it way more detailed than this

dense ferry
#

If you mean events like in remote events then perhaps you could put in replicated storage a stringvalue

You could just set the value with certain parameters.
In another script check if the value has been changed and use it's values ('arguments').