vlatkovski

GetService Metatable

Mar 14th, 2015
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. service = setmetatable({game = game}, {
  2.     __index = function(t, i)
  3.         local serviceNames = {"Workspace"; "Players"; "Lighting"; "ReplicatedFirst"; "ReplicatedStorage"; "ServerScriptService"; "ServerStorage"; "StarterGui"; "StarterPack"; "StarterPlayer"; "UserInputService"; "CoreGui"; "Teams"; "SoundService"; "AssetService"; "BadgeService"; "CSGDictionaryService"; "ChangeHistoryService"; "Chat"; "ContentProvider"; "ContextActionService"; "Debris"; "InsertService"; "LogService"; "MarketplaceService"; "PointsService"; "RunService"; "TeleportService"; "TestService"; "HttpService"; "PhysicsService"; "Geometry"; "GuiService"; "CollectionService"; "Selection";};
  4.         for _,sn in pairs(serviceNames) do
  5.             if (sn:lower():sub(1, #i) == i:lower()) then
  6.                 return game:GetService(sn);
  7.             end
  8.         end
  9.         return string.format("Couldn't find a service with name '%s'", i);
  10.     end
  11. });
  12.  
  13. print(service.runs)
  14. print(service.geo)
  15. print(service.worksp)
  16. print(service.playe)
  17. print(service.light)
  18. print(service.chat)
  19. print(service.deb)
  20. print(service.marketplace)
  21. print(service.ins)
  22. print(service.ass)
  23. print(service.BANANASERVICE)
  24.  
  25.  
  26.  
  27. -- roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox
Advertisement
Add Comment
Please, Sign In to add comment