What is game:service()?

I was looking through the Kohl’s Admin Loader script and found this line of code:

It seems to do the same thing as game:FindService() and game:GetService(). I then try using it on teams while it’s not in the datamodel, and it did the same thing as GetService(); it loaded in teams.

print(game:service('Teams'))

I’ve just never seen this before, is there anything different about it? Can’t seem to find it in the developer hub, or anything about it.

:service() is the deprecated version of :GetService(). That’s pretty much it.

1 Like

It’s just an old version of game:GetService, however Roblox has adopted PascalCase as the naming convention over the years, so game:service is just a relic from the camelCase days.

2 Likes

Yeah I was just confused because I would think the module would use an undeprecated version of something. I would assume so but again couldn’t find anything on it. Thank you.

Here is an example of :GetService.

1. local badgeService = game:GetService("BadgeService")
2. local gameSettings = UserSettings():GetService("UserGameSettings")
1 Like

Yes I know what GetService does, I just didn’t know what the deprecated version was.