Hello, is there currently a way to use luau to implement signal in multiple threads (without using bindableevent)?
I’m implementing a signal and I can’t modify the value in multiple threads by looking up because of the luau single thread single env.
The project is progressing I’m using sharedTable to document script sources
local Actor: Actor = nil -- Path to actor
Actor:BindToMessage() or Actor:BindToMessageParallel() -- get messages (usually I don't use parallel)
Actor:SendMessage() -- send messages
1 Like
thank you. I haven’t tried your method yet
function Signal:FireParallel(sc, ...)
print(MUI_ACTORS_CALLBACKS)
for i=1, SharedTable.size(MUI_ACTORS_CALLBACKS) do
local currentSources = MUI_ACTORS_CALLBACKS[i]
f
end
end
function Signal:ConnectParallel(sc: Script, func)
local actor = sc:GetActor()
local connectionSources = string.split(debug.info(2, "s"), ".")
local connection = {
func = func,
connected = true,
Disconnect = function()
end,
}
if actor then
MUI_ACTORS_CALLBACKS[SharedTable.size(MUI_ACTORS_CALLBACKS) + 1] = connectionSources
actor:BindToMessageParallel(connectionSources, func)
end
return connection
end
now I can retrieve listeners from another actor
You should mark my post as the solution if you don’t have the issue anymore (if I helped; if I didn’t help, mark your own post as the solution)