LawMixer

Untitled

Jul 8th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.76 KB | None | 0 0
  1.  
  2. local Players = game:GetService("Players")
  3. local UserInputService = game:GetService("UserInputService")
  4. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  5. local StarterGui = game:GetService("StarterGui")
  6. local LoadingScreen = require(script:WaitForChild("LoadingScreen"))
  7. local player = game:GetService("Players").LocalPlayer
  8. local mouse = player:GetMouse()
  9. local playerGui = player:WaitForChild("PlayerGui")
  10. local inv = require(script.InventoryController)
  11. local done = false
  12. local screen = LoadingScreen.new(playerGui)
  13. local Interact = require(script.InteractController)
  14.  
  15. StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
  16. StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
  17.  
  18.  
  19. local Services = {}
  20.  
  21.  
  22.  
  23.  
  24. local coreUI = Instance.new("ScreenGui")
  25. coreUI.Name = "CoreUI"
  26. coreUI.Parent = player:WaitForChild("PlayerGui")
  27. screen.ServerFinished:Connect(function()
  28. if done then
  29. return
  30. end
  31. done = true
  32. for _, service in pairs(script:GetChildren()) do
  33. if service:IsA("ModuleScript") then
  34. Services[service.Name] = require(service)
  35. end
  36. end
  37. local suc
  38. repeat
  39. suc = pcall(function()
  40. StarterGui:SetCore("ResetButtonCallback", false)
  41. end)
  42. wait()
  43. until suc
  44. Services.KeyBinder.Init(playerGui)
  45. Services.PlayerList.Init(playerGui)
  46. Services.NotificationHandler.Init(playerGui)
  47. Services.Minimap.Init()
  48. Services.BankController.Init()
  49. Services.Components.Init(playerGui)
  50. Services.InventoryController.Init(playerGui)
  51. Services.ZoneController.Init()
  52. Services.ElectionController.Init(playerGui)
  53. screen:SendResponse()
  54. end)
  55. local humanoid
  56. local function SetupDefaults(humanoid)
  57. UserInputService.MouseDeltaSensitivity = 1
  58. mouse.Icon = ""
  59. end
  60. local loaded = false
  61. local function GetHumanoid(char)
  62. if char then
  63. Services.DynamicArms.Deactivate()
  64. Services.InteractController.Init()
  65. Services.Verificator.Init()
  66. humanoid = char:WaitForChild("Humanoid")
  67. Services.MovementController.OnDeath()
  68. Services.MovementController.InitHumanoid(humanoid)
  69. SetupDefaults(humanoid)
  70. Services.JusticeController.InitHumanoid(humanoid)
  71. Services.KeyBinder.InitHumanoid(humanoid)
  72. Services.InventoryController.InitHumanoid(humanoid)
  73. Services.VehicleController.InitHumanoid(humanoid, playerGui)
  74. Services.Minimap.InitHumanoid(humanoid)
  75. Services.BankController.InitHumanoid(humanoid)
  76. Services.ClientFunctions.InitHumanoid(humanoid)
  77. Services.RadioController.Init(playerGui, humanoid)
  78. Services.JusticeController.CheckJail(humanoid, playerGui)
  79. Services.ToolHandler.Init(humanoid)
  80. Services.DynamicArms.Init(humanoid)
  81. if not loaded then
  82. loaded = true
  83. do
  84. local cmdr = require(ReplicatedStorage:WaitForChild("Resources").Libraries:WaitForChild("CmdrClient"))
  85. local roles = Services.Verificator.GetPlayerRoles()
  86. cmdr:SetEnabled(roles.Moderator or roles.Admin or false)
  87. cmdr:SetActivationKeys({
  88. Enum.KeyCode.Semicolon
  89. })
  90. screen:End()
  91. local hotkeyEnabled = false
  92. local currentState = true
  93. local hideNames = false
  94. local lastHit = tick()
  95. local Assets = require(ReplicatedStorage.Databases.Assets)
  96. local chars = {}
  97. local function PlayerAdded(argPlayer)
  98. local function CharAdded(argChar)
  99. local hum = argChar:WaitForChild("Humanoid")
  100. hum.DisplayDistanceType = not (not currentState and hideNames) and Enum.HumanoidDisplayDistanceType.Viewer or Enum.HumanoidDisplayDistanceType.None
  101. chars[argPlayer] = hum
  102. end
  103. argPlayer.CharacterAdded:Connect(CharAdded)
  104. if argPlayer.Character then
  105. CharAdded(argPlayer.Character)
  106. end
  107. end
  108. Players.PlayerAdded:Connect(PlayerAdded)
  109. Players.PlayerRemoving:Connect(function(plr)
  110. chars[plr] = nil
  111. end)
  112. for _, v in pairs(Players:GetPlayers()) do
  113. PlayerAdded(v)
  114. end
  115. local guis = {}
  116. local function ChildAdded(child)
  117. if child:IsA("LayerCollector") then
  118. guis[child] = true
  119. child.Enabled = currentState
  120. end
  121. end
  122. playerGui.ChildAdded:Connect(ChildAdded)
  123. playerGui.ChildRemoved:Connect(function(child)
  124. guis[child] = nil
  125. end)
  126. for _, v in pairs(playerGui:GetChildren()) do
  127. ChildAdded(v)
  128. end
  129. UserInputService.InputBegan:Connect(function(inputObject, processed)
  130. if processed or not hotkeyEnabled then
  131. return
  132. end
  133. if inputObject.KeyCode == Enum.KeyCode.Backquote then
  134. local thisHit = tick()
  135. if thisHit - lastHit <= 0.5 then
  136. currentState = not currentState
  137. local ctrlDown = UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) or UserInputService:IsKeyDown(Enum.KeyCode.RightControl)
  138. local shiftDown = UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) or UserInputService:IsKeyDown(Enum.KeyCode.RightShift)
  139. for gui, _ in pairs(guis) do
  140. gui.Enabled = currentState
  141. end
  142. if player.Character then
  143. for _, v in pairs(player.Character:GetDescendants()) do
  144. if v:IsA("BasePart") or v:IsA("Decal") then
  145. v.LocalTransparencyModifier = not (not currentState and ctrlDown) and 0 or 1
  146. end
  147. end
  148. end
  149. mouse.Icon = currentState and "" or Assets.Blank
  150. hideNames = shiftDown
  151. for _, v in pairs(chars) do
  152. v.DisplayDistanceType = not (not currentState and hideNames) and Enum.HumanoidDisplayDistanceType.Viewer or Enum.HumanoidDisplayDistanceType.None
  153. end
  154. end
  155. lastHit = tick()
  156. end
  157. end)
  158. local function CheckHideGuis()
  159. local roles = Services.Verificator.GetPlayerRoles()
  160. hotkeyEnabled = roles.PBSTeam
  161. end
  162. CheckHideGuis()
  163. Services.Verificator.OnVerifyUpdate:Connect(CheckHideGuis)
  164. end
  165. end
  166. end
  167. end
  168. wait(1)
  169. GetHumanoid(player.Character)
  170. player.CharacterAdded:Connect(GetHumanoid)
Add Comment
Please, Sign In to add comment