Using a module script to require services

Im curious to know if using a module script to store services for all scripts is actually a good thing for performance. For server and client use

I see what your trying to do, but there is actually a way better way of doing this that i use in all my scripts:

local S = setmetatable({}, {__index = function(_, g) return game:GetService(g) end})
--so now, instead of writing:
game:GetService("Players")
--you can just write
S.Players
--or instead of
game:GetService("UserInputService")
-- you can do
S.UserInputService

and this does it through game:GetService(“Players”), not game.Players.

3 Likes