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

Why do I need to use the function GetService()?

Asked by
TMGOR 20
7 years ago

I know a bit of python and how to import modules into code such as import random. This essentially imports bits of prewritten code and functions into your game such as: print(random.randint(25,50)). The imported function is random.randint(25,50) which generates a random number between 25,50. The thing I want to know is, is GetService() the same thing as the import?

Does GetService() import prewritten functions into your game, and if not, why are they needed? Thanks in advance.

0
It creates or gets the service safely, it is commonly used on the client side as it is possible to change the name of a service which could break scripts. User#5423 17 — 7y
0
There is a function called FindService which is not commonly used but will return nil if the service has not been created. User#5423 17 — 7y
0
Modules are the stuff you import in roblox Disillusions 61 — 7y

Answer this question