Created
November 24, 2025 19:15
-
-
Save jLn0n/6325e0e07559b7f20312eb7afefef790 to your computer and use it in GitHub Desktop.
workspace.SignalBehavior check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local function isDeferred(): boolean | |
| local result = true | |
| local eventus = Instance.new("BindableEvent") | |
| eventus.Event:Once(function() | |
| result = false | |
| eventus:Destroy() | |
| end) | |
| eventus:Fire() | |
| return result | |
| end | |
| local function isAncestryDeferred(): boolean | |
| local result = false | |
| local container = Instance.new("Folder") | |
| local check = Instance.new("Folder", container) | |
| container.DescendantRemoving:Once(function() | |
| result = not check.Parent | |
| end) | |
| container:Destroy() | |
| return result | |
| end | |
| local SIGNAL_BEHAVIOR = (function() | |
| task.wait() -- waits for a frame so there would be no false-positives on Client | |
| if isDeferred() then | |
| return Enum.SignalBehavior.Deferred | |
| elseif isAncestryDeferred() then | |
| return Enum.SignalBehavior.AncestryDeferred | |
| end | |
| return Enum.SignalBehavior.Immediate | |
| end)() | |
| print(SIGNAL_BEHAVIOR) |
Author
Author
i know the Deferred check is known but i just want to share something to the community
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how this works?
check's parent would be checked if Parent is not nil in DescendantRemoving since signals still does act Immediate