I do know what game:GetService does, (It gets the service if someone changes the name or inserts it if not already there), but people tend to use, for example: game.ServerStorage, but not game.HttpService
I never see people use game.HttpService, but game.ServerStorage. Why?
because httpservice doesn’t show up in the explorer, it’s not a child of “game” so you can’t use game.HttpService to get it
You can use game.HttpService to get it, I have used it before and it is a child of game.
Actually services can be shown in the explorer. Under settings in roblox studio there’s an option to show hidden services. In addition, HttpService isn’t in the game object.
EDIT: yes it is, my bad!
huh didn’t know that lol the more you know then i guess
It is, and you can. But some services (at least in the past) didn’t load immediately (such as Teams) and GetService would initialize the service if it wasn’t already running.
Most people go to insert service to insert it in studio first. Or atleast I do.
For Teams, yes. That’s not InsertService, but I think I know what you mean.
One more detail, it will get the service even if the service was renamed by either you or Roblox via an update. So GetService(“ReplicatedStorage”) will get ReplicatedStorage even if ReplicatedStorage was renamed to something like RS for simplicity, which I’ve heard Tomarty does.
I have said this in my post, but people tend to use: game.Workspace alot, and not game.HiddenService
But some services (at least in the past) didn’t load immediately
This doesn’t make sense to me. I used CloneTrooper’s roblox studio mod manager to revert to a really old version, this version didn’t even load the game when I play tested but I still got all services as well as a camera in the workspace.
EDIT: While this could be because it’s already loaded in studio, you can still kinda tell that it’s preloaded on the roblox mobile app because when you switch pages, you get that one scene that looks like 3/4ths of a baseplate and the sky.
I always do this for services already created. I dont think it makes a huge difference (or any) on how you get the service. Does anyone know if FindService is even better than GetService for already created services?
You’re right, sorry that I was hasty. It’s more of a tradition I think. Everyone has been simply using game.Workspace for so long, and it permeates all tutorials everywhere. Workspace is unlikely to ever be renamed, it has to exist for the game to be playable, and it’s one of the oldest services. I couldn’t say exactly, but there is no reason why you couldn’t use GetService on workspace and I’m sure it’s just an ancient habit.
Well game.Workspace was an example, I use workspace
with syntax highlighting.
If you do game.ServiceName you’re indexing a property of a datamodel not a service which is considered bad practice.
ServerStorage is also a service, why is it not bad to use game.ServerStorage?
Well, the thing is… it is just as bad.
It’s the same, people just got used to using game.ServerStorage instead of game:GetService(“ServerStorage”)
If that is the case then I agree with @JarodOfOrbiter that it is a tradition, I have seen the same people use game.ServerStorage
and not game.HttpService
I know it is the same, I just do not know why people tend to do that with hidden services and not shown services?