Universal Script πŸ“Œ
890 Views
3.0k Executions

faster fire all events

Universal Script πŸ“Œ
Intiha
IntihaFirst script
11 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No 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

View Raw
local descendants = game:GetDescendants()

for i = 1, #descendants do
    local v = descendants[i]
    if v.ClassName == "RemoteEvent" then
        v:FireServer()
    end
end



Comments

8
Log in to join the conversation. Login
lightnohelp's profile picture
lightnohelp11 months ago

*

1
CatBoyy's profile picture
CatBoyy11 months ago

ew GetDescendants

0
Intiha's profile picture
IntihaUploader11 months ago(edited)

@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)

1
CatBoyy's profile picture
CatBoyy11 months ago

@Intiha Imagine not using better GetDescendants

1
Intiha's profile picture
IntihaUploader11 months ago

@CatBoyy huh.. so do you mean scoping the search?

1
CatBoyy's profile picture
CatBoyy11 months ago

@Intiha QueryDescendants

1
Intiha's profile picture
IntihaUploader11 months ago

@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.

1
Intiha's profile picture
IntihaUploader11 months ago(edited)

+ 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

1

More universal scripts

See all
Script hub
178.8k
1.7M
Bumped 3 hours ago
Key System
Universal Script πŸ“Œ
9.1k
31.5k
Bumped 4 hours ago
Script hub
49.8k
12.3k
Bumped 4 hours ago
Key System
Paid
Script hub
5.5M
1.1M
Bumped 9 hours ago
Key System
Script hub
20.6k
4.0k
Bumped 9 hours ago
Key System
Paid
Universal Script πŸ“Œ
723
209
Approved 15 hours ago
Universal Script πŸ“Œ
627
2.5k
Approved 15 hours ago
Universal Script πŸ“Œ
588
589
Approved 16 hours ago