Does :GetService lag the game?

if i use a ton of getservice in every script will it eventually lag the game? since i have alot of moves in serverstorage and i have a list that gets like 6-7 services each script, and i heard somewhere that it lags the game, im like almost 100% sure it doesnt but checking is always nice. thanks.

1 Like

ServiceProvider:GetService() does not lag the game. It simply returns the type of service depending on the string being provided.

2 Likes

Absolutely not. GetService() is actually a very efficient way of getting a service. GetService() exists to get a service that may not have loaded yet in order to prevent the returning of errors.

Using game.RunService has a chance of returning an error because the service has not loaded just yet. However, GetService() will create the service in case if the service you are trying to do something with does not exist yet, so it won’t return an error.

Hope this helped you!

2 Likes

thanks alot guys appreciate it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.