Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Loading = {}
- Loading.__index = Loading
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local StarterGui = game:GetService("StarterGui")
- local ContentProvider = game:GetService("ContentProvider")
- local RemoteHandler = require(script.Parent:WaitForChild("RemoteHandler"))
- local Z_INDEX = 20
- local BACKGROUND_COLOR = Color3.fromRGB(45, 45, 45)
- local TIP_RATE = 8
- local TIPS = {
- "Weaponry may be purchased in Plymouth, West Point and Lander",
- "You may purchase vehicles at the dealerships located in Plymouth, West Point and Lander",
- "Any bugs or glitches should be sent to Bulldo344 or any developer with a screenshot of the F9 console",
- "The Township of Plymouth is the County Seat of New Haven",
- "In order to join any Law Enforcement Agency, you must be certified by the Law Enforcement Training Institute",
- "Road speeds are strictly enforced: BE AWARE OF YOUR SPEED!",
- "Sustain enough damage to your vehicle and it won't be around much longer",
- "By obtaining citizenship, you have the right to own property, join an emergency service, run for public office and vote",
- "The higher your rank the more you earn",
- "Our prison sentences aren't long but don't underestimate the power of the law",
- "Don't forget to pay your citations at any police station soon, or expect a warrant out for your arrest",
- "You can respray your vehicle next to the Plymouth or Lander Gas Station",
- "To own a firearm legally, you must purchase a firearm's license in the Plymouth courthouse",
- "There are 4 law enforcement agencies",
- "The game is still in early development",
- "Remember to follow the Roblox Terms of Service while you're here",
- "\"Glitching\" may result in a ban",
- "Desolate houses and dark basements are perfect places for hiding from law enforcement",
- "Make sure if you want to report a crime, you provide evidence",
- "Be careful of who you kill. Bad luck may start heading your way",
- "There are 15 different teams in New Haven County",
- "There have been reports of unidentified flying objects over the State",
- "The Mayflower Reborn Sheriff is elected by the People",
- "The Mayflower Reborn Sheriff's Office was established in 1852",
- "The Mayflower Reborn Governorment stablished a Volunteer Fire Company in 1773, which has gone on to become a fully paid fire and medical service",
- "The Mayflower State Bar is integrated into the Constitution and membership is mandatory for those wishing to practice law",
- "By 1902, Plymouth decided to incorporate the municipal police department, which is currently headquartered near the Plymouth Bridge",
- "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",
- "Fort Standish was constructed in 1861",
- "Lander's Mayor amalgamated two District Constabularies to form the LPD in 1861",
- "The Mayflower Parks and Wildlife Department was established in 1916 by Governor R Beauregard",
- "Conscription is currently illegal and not enforced",
- "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",
- "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"
- }
- local loadingRemote = RemoteHandler.Event.new("LoadingEnd")
- local startFrame = ReplicatedStorage.UI.LoadingFrame
- local function LoadAllAssets(recur)
- for i, v in pairs(recur) do
- if typeof(v) == "string" and v:sub(1, 13) == "rbxassetid://" then
- ContentProvider:Preload(v)
- elseif typeof(v) == "table" then
- LoadAllAssets(v)
- end
- end
- end
- local Loading = {}
- Loading.__index = Loading
- function Loading.new(playerGui)
- local self = {}
- setmetatable(self, Loading)
- local gui = Instance.new("ScreenGui")
- gui.DisplayOrder = 3
- gui.Name = "Loading"
- gui.ResetOnSpawn = false
- gui.Parent = playerGui
- self.Active = true
- StarterGui:SetCore("TopbarEnabled", false)
- local frame = startFrame:Clone()
- frame.Parent = gui
- self.Gui = frame
- local loadingLabel = frame:WaitForChild("CenterFrame"):WaitForChild("LoadingLabel")
- self.LoadingLabel = loadingLabel
- local tipLabel = frame:WaitForChild("CenterFrame"):WaitForChild("TipLabel")
- tipLabel.Text = TIPS[math.random(#TIPS)]
- self.TipLabel = tipLabel
- local progressBar = frame:WaitForChild("LoadingBar"):WaitForChild("ProgressBar")
- self.ProgressBar = progressBar
- local corner = frame:WaitForChild("CornerFrame")
- self.Corner = corner
- self.ServerFinished = loadingRemote.OnEvent
- spawn(function()
- while self.Active do
- wait(TIP_RATE)
- local tip
- repeat
- tip = TIPS[math.random(#TIPS)]
- until tip ~= tipLabel.Text
- self:ChangeTip(tip)
- end
- end)
- local biggest = 0
- while frame and frame.Parent do
- local size = ContentProvider.RequestQueueSize
- if biggest < size then
- biggest = size
- end
- progressBar:TweenSize(UDim2.new(math.clamp(biggest / size, 0, 1), 0, 1, 0), "Out", "Quad", 0.5)
- if size <= 0 then
- break
- end
- wait()
- end
- loadingLabel.Text = "Loading Data"
- return self
- end
- function Loading:SendResponse()
- self.LoadingLabel.Text = "Loading Character"
- loadingRemote:Fire()
- end
- function Loading:ChangeTip(newTip)
- if not self.Active then
- return
- end
- self.TipLabel:TweenPosition(UDim2.new(0, 0, 0, 200), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true, function()
- if self.Active then
- self.TipLabel.Text = newTip
- self.TipLabel:TweenPosition(UDim2.new(0, 0, 0, 142), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25)
- end
- end)
- end
- function Loading:End()
- if self.Gui and self.Gui.Parent and self.Active then
- self.Active = false
- self.Gui:TweenPosition(UDim2.new(0, 0, 1, 36), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.75, true, function()
- self.Gui:Destroy()
- self = nil
- end)
- end
- end
- return Loading
Add Comment
Please, Sign In to add comment