LawMixer

Untitled

Jul 8th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.92 KB | None | 0 0
  1. local Loading = {}
  2. Loading.__index = Loading
  3. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  4. local StarterGui = game:GetService("StarterGui")
  5. local ContentProvider = game:GetService("ContentProvider")
  6. local RemoteHandler = require(script.Parent:WaitForChild("RemoteHandler"))
  7. local Z_INDEX = 20
  8. local BACKGROUND_COLOR = Color3.fromRGB(45, 45, 45)
  9. local TIP_RATE = 8
  10. local TIPS = {
  11. "Weaponry may be purchased in Plymouth, West Point and Lander",
  12. "You may purchase vehicles at the dealerships located in Plymouth, West Point and Lander",
  13. "Any bugs or glitches should be sent to Bulldo344 or any developer with a screenshot of the F9 console",
  14. "The Township of Plymouth is the County Seat of New Haven",
  15. "In order to join any Law Enforcement Agency, you must be certified by the Law Enforcement Training Institute",
  16. "Road speeds are strictly enforced: BE AWARE OF YOUR SPEED!",
  17. "Sustain enough damage to your vehicle and it won't be around much longer",
  18. "By obtaining citizenship, you have the right to own property, join an emergency service, run for public office and vote",
  19. "The higher your rank the more you earn",
  20. "Our prison sentences aren't long but don't underestimate the power of the law",
  21. "Don't forget to pay your citations at any police station soon, or expect a warrant out for your arrest",
  22. "You can respray your vehicle next to the Plymouth or Lander Gas Station",
  23. "To own a firearm legally, you must purchase a firearm's license in the Plymouth courthouse",
  24. "There are 4 law enforcement agencies",
  25. "The game is still in early development",
  26. "Remember to follow the Roblox Terms of Service while you're here",
  27. "\"Glitching\" may result in a ban",
  28. "Desolate houses and dark basements are perfect places for hiding from law enforcement",
  29. "Make sure if you want to report a crime, you provide evidence",
  30. "Be careful of who you kill. Bad luck may start heading your way",
  31. "There are 15 different teams in New Haven County",
  32. "There have been reports of unidentified flying objects over the State",
  33. "The Mayflower Reborn Sheriff is elected by the People",
  34. "The Mayflower Reborn Sheriff's Office was established in 1852",
  35. "The Mayflower Reborn Governorment stablished a Volunteer Fire Company in 1773, which has gone on to become a fully paid fire and medical service",
  36. "The Mayflower State Bar is integrated into the Constitution and membership is mandatory for those wishing to practice law",
  37. "By 1902, Plymouth decided to incorporate the municipal police department, which is currently headquartered near the Plymouth Bridge",
  38. "The Mayflower State Police is the state-wide law enforcement agency, directed by the Constitution of Mayflower to protect members of the government on the list of succession",
  39. "Fort Standish was constructed in 1861",
  40. "Lander's Mayor amalgamated two District Constabularies to form the LPD in 1861",
  41. "The Mayflower Parks and Wildlife Department was established in 1916 by Governor R Beauregard",
  42. "Conscription is currently illegal and not enforced",
  43. "The National Guard is commanded by the Governor, who in turn appoints a Major General to oversee the standards and battle readiness of the National Guard",
  44. "Following several malicious attacks on the People of Mayflower, the State Militia (now known as the National Guard) was created as a buffer to defend the liberties and freedoms inherent of every Citizen"
  45. }
  46. local loadingRemote = RemoteHandler.Event.new("LoadingEnd")
  47. local startFrame = ReplicatedStorage.UI.LoadingFrame
  48. local function LoadAllAssets(recur)
  49. for i, v in pairs(recur) do
  50. if typeof(v) == "string" and v:sub(1, 13) == "rbxassetid://" then
  51. ContentProvider:Preload(v)
  52. elseif typeof(v) == "table" then
  53. LoadAllAssets(v)
  54. end
  55. end
  56. end
  57. local Loading = {}
  58. Loading.__index = Loading
  59. function Loading.new(playerGui)
  60. local self = {}
  61. setmetatable(self, Loading)
  62. local gui = Instance.new("ScreenGui")
  63. gui.DisplayOrder = 3
  64. gui.Name = "Loading"
  65. gui.ResetOnSpawn = false
  66. gui.Parent = playerGui
  67. self.Active = true
  68. StarterGui:SetCore("TopbarEnabled", false)
  69. local frame = startFrame:Clone()
  70. frame.Parent = gui
  71. self.Gui = frame
  72. local loadingLabel = frame:WaitForChild("CenterFrame"):WaitForChild("LoadingLabel")
  73. self.LoadingLabel = loadingLabel
  74. local tipLabel = frame:WaitForChild("CenterFrame"):WaitForChild("TipLabel")
  75. tipLabel.Text = TIPS[math.random(#TIPS)]
  76. self.TipLabel = tipLabel
  77. local progressBar = frame:WaitForChild("LoadingBar"):WaitForChild("ProgressBar")
  78. self.ProgressBar = progressBar
  79. local corner = frame:WaitForChild("CornerFrame")
  80. self.Corner = corner
  81. self.ServerFinished = loadingRemote.OnEvent
  82. spawn(function()
  83. while self.Active do
  84. wait(TIP_RATE)
  85. local tip
  86. repeat
  87. tip = TIPS[math.random(#TIPS)]
  88. until tip ~= tipLabel.Text
  89. self:ChangeTip(tip)
  90. end
  91. end)
  92. local biggest = 0
  93. while frame and frame.Parent do
  94. local size = ContentProvider.RequestQueueSize
  95. if biggest < size then
  96. biggest = size
  97. end
  98. progressBar:TweenSize(UDim2.new(math.clamp(biggest / size, 0, 1), 0, 1, 0), "Out", "Quad", 0.5)
  99. if size <= 0 then
  100. break
  101. end
  102. wait()
  103. end
  104. loadingLabel.Text = "Loading Data"
  105. return self
  106. end
  107. function Loading:SendResponse()
  108. self.LoadingLabel.Text = "Loading Character"
  109. loadingRemote:Fire()
  110. end
  111. function Loading:ChangeTip(newTip)
  112. if not self.Active then
  113. return
  114. end
  115. self.TipLabel:TweenPosition(UDim2.new(0, 0, 0, 200), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true, function()
  116. if self.Active then
  117. self.TipLabel.Text = newTip
  118. self.TipLabel:TweenPosition(UDim2.new(0, 0, 0, 142), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25)
  119. end
  120. end)
  121. end
  122. function Loading:End()
  123. if self.Gui and self.Gui.Parent and self.Active then
  124. self.Active = false
  125. self.Gui:TweenPosition(UDim2.new(0, 0, 1, 36), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.75, true, function()
  126. self.Gui:Destroy()
  127. self = nil
  128. end)
  129. end
  130. end
  131. return Loading
Add Comment
Please, Sign In to add comment