
879 Views
2.9k Executions
faster fire all events
Universal Script π
IntihaFirst script
10 months ago
Please login to perform these actions:Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
faster version of eh's one at https://scriptblox.com/script/Universal-Script-fire-all-remote-events-77187
local descendants = game:GetDescendants()
for i = 1, #descendants do
local v = descendants[i]
if v.ClassName == "RemoteEvent" then
v:FireServer()
end
end









*
ew GetDescendants
@CatBoyy bro, this is faster + single pass, array indexing, minimal checks, no extra work, and who cares if its friggin getdescendants, theres no faster way that uses O(1)
@Intiha Imagine not using better GetDescendants
@CatBoyy huh.. so do you mean scoping the search?
@Intiha QueryDescendants
@CatBoyy QueryDescendants could reduce constant factors by filtering, but asymptotically itβs still O(n). my version is still near-optimal for universal one-shot scans.
+ O(1) is impossible β scanning an unknown tree of nodes must be O(n), you cannot find all RemoteEvents without touching each node at least once Any claim of O(1) here is just wishful thinking