Quick question about "RBXScriptSignal:Once()"

The title explains it all. Im curious about what “RBXScriptSignal:Once()” does. There isnt really any info/documentation about it.


All i want to know is what exactly it does. Does it do what is tells you runs the function once?

It disconnects the signal once it runs. So you don’t have to do:

local connection = nil
connection = RBXScriptSignal:Connect(function()
   connection:Disconnect()
end)

-- RBXScriptSignal:Once() does this automatically
9 Likes

Its as good as @HugeCoolboy2007 discribed above, instead of the :Connect where is fires every time from its connection to its disconnection (or destroyed), Once only fires once and never again. This is useful since you don’t have to use the risky method shown above and is a bit overdue.

2 Likes

New feature? Nice! This is exactly what I needed.

They should really be clearer about these updates.

1 Like