Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it good or bad to have a lot of remote events?

Asked by 4 years ago

As my game goes deeper into development, I find myself using a lot of remote events (most of them are used to spawn items from the same GUI). The question is whether my game is prone to breaking if there are too many of them. If so, is there a way to limit the amount of them so that clients can still spawn items using remote event?

2 answers

Log in to vote
-1
Answered by 4 years ago
Edited 4 years ago

Adding too many RemoteEvents will make game loading times slower (not sure, but too much of anything wil slow down your game), so it would be wise to use the parameters feature of RemoteEvents to spawn in different items. Local (enclose in a clicked event for a gui)

game.ReplicatedStorage.SpawnItem:FireServer(1)

Script (not very efficient but just an example):

game.ReplicatedStorage.SpawnItem.OnServerEvent:Connect(function(item)
    if item==1 then
        --item 1
    elseif item==2 then
        --item 2
    end
end)
0
Do you have any source which can back up your claim that too many remotes make game loading times slower? Amiaa16 3227 — 4y
Ad
Log in to vote
1
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
4 years ago

There's no limit of how many remotes you can have, nor will they cause your game to break. Though if you do have too many of them, it might be easy for you to get confused or forget which does what, etc.

Answer this question