do you need to use GetService, FindService or anything else in Server-Script ?
what do you mean by that, no you donât NEED to use GetService for a script, itâs just a function that you can use to get a service.
i meant, is it useful to use GetService, FindService in a Server-Script
Itâs typically good practice to use game:GetService on the server and the client for two reasons (although there could be more):
1- If a service is renamed, the correct service will still be returned.
2- If a service doesnât exist yet, itâll be created.
If a service doesnât exist or is renamed and you try to index the game with that member using a period or square brackets (ie. game.Players, game[âRun Serviceâ]), youâll get a â___ is not a valid member of DataModelâ error.
game:GetService(âServiceNameâ) is the best practice.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.