So i have been scripting and have seen people use
game:GetService('Players')
that is just one example, but i have always done it like
game.Players
Does this only work because im in experimental mode? does FE change this?
So i have been scripting and have seen people use
game:GetService('Players')
that is just one example, but i have always done it like
game.Players
Does this only work because im in experimental mode? does FE change this?
game:GetService("Players")
Is like
:waitForChild()
It waits for the service to be ready, while,
game.Players
Simply references the service.
Well, it's kinda weird. Let me try to explain.
The game has tons of "Services" like Players, the one you mentioned. It has other services, such as TweenService, RunService, etc etc etc. GetService() Finds these services, and if they don't exist, it creates a new one. It gets a bit more complicated, i.e. this Reddit post shows how using GetService() can differ from just using game.ServiceName. But, basically, it usually won't matter if you use GetService or not.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
some time in normal server if your code have something like "game.ServerStorage" then it can give a error like "ServerStorage is not a valid member of DataModel" but if your code have "game:GetService("ServerStorage")" then the script will work fine, In experimental mode both looks same but if you publish the place and play it with roblox player then it make deference.
http://wiki.roblox.com/index.php?title=GetService research plz qq