it loads really quick since i just have a baseplate ill give you a snippet of all the code so you have an understanding
local UserInputService = game:GetService("UserInputService")
local ContentProvider = game:GetService("ContentProvider")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Interface = script.Loading
local HighPing, HighFrames, ErrorTween = false, false, false
local Loading = true
local Bypass = true
local OneTick, TwoTick, ThreeTick, SmesyTime = tick(), tick(), tick(), tick()
local Assets = {}
local function SetupOne()
if RunService:IsStudio() then
local DebugTween = TweenService:Create(Interface.Frame.Debug, TweenInfo.new(0.48, Enum.EasingStyle.Quint), {TextTransparency = 0})
DebugTween:Play()
DebugTween.Completed:Wait()
Interface.Frame.Debug.Text = "GameID: " .. game.GameId .. ", VersionID: " .. game.PlaceVersion
end
ReplicatedFirst:RemoveDefaultLoadingScreen()
Interface.Parent = Player.PlayerGui
Interface.Frame.Visible = true
UserInputService.MouseIconEnabled = false
local Module = require(Player.PlayerScripts:WaitForChild("PlayerModule"))
Module:GetControls():Disable()
local function RandomizeSounds(Parent)
for Index, Sound in pairs(Parent:GetChildren()) do
if Sound:IsA("Sound") then
local RandomSpeed = math.random(9, 11) * 0.1
Sound.PlaybackSpeed = RandomSpeed
local RandomVolume = math.random(4, 8) * 0.1
Sound.Volume = RandomVolume
end
end
end
RandomizeSounds(script.Sounds)
end
RunService.Heartbeat:Connect(function()
if Loading then
local Ping = Player:GetNetworkPing() * 2000
local Frames = math.floor(game.Workspace:GetRealPhysicsFPS())
if RunService:IsStudio() then
warn("[LOAD] Ping: " .. Ping)
warn("[LOAD] Frames: " .. Frames)
end
if Ping > 80 then
if not ErrorTween then
local RealErrorTween = TweenService:Create(Interface.Frame.Error, TweenInfo.new(1.2, Enum.EasingStyle.Quint), {TextTransparency = 0})
RealErrorTween:Play()
ErrorTween = true
script.Sounds.Error:Play()
end
HighPing = true
else
HighPing = false
end
if Frames < 60 then
if not ErrorTween then
local RealErrorTween = TweenService:Create(Interface.Frame.Error, TweenInfo.new(1.2, Enum.EasingStyle.Quint), {TextTransparency = 0})
RealErrorTween:Play()
ErrorTween = true
script.Sounds.Error:Play()
end
HighFrames = true
else
HighFrames = false
end
if ErrorTween then
if HighFrames and not HighPing then
Interface.Frame.Error.Text = "Your frames per second is high, and pausing is to be expected."
elseif HighPing and not HighFrames then
Interface.Frame.Error.Text = "Your ping is high, and lagging is to be expected."
elseif HighPing and HighFrames then
Interface.Frame.Error.Text = "Your ping and frames are high, and it's YOUR problem."
elseif not HighPing and not HighFrames then
local RealErrorTween = TweenService:Create(Interface.Frame.Error, TweenInfo.new(1.2, Enum.EasingStyle.Quint), {TextTransparency = 1})
RealErrorTween:Play()
ErrorTween = false
end
end
end
end)
local function SetupTwo()
local function GetAssets()
for Index, Asset in pairs(game:GetChildren()) do
table.insert(Assets, Asset)
task.wait()
end
end
warn("[LOAD] Retrieving assets.")
GetAssets()
warn("[LOAD] Retrieved assets in " .. tostring(math.round(tick() - TwoTick)) .. " seconds.")
local LoadTween = TweenService:Create(Interface.Frame.Start, TweenInfo.new(0.62, Enum.EasingStyle.Quint), {TextTransparency = 1})
LoadTween:Play()
LoadTween.Completed:Wait()
local HideTween = TweenService:Create(Interface.Hide, TweenInfo.new(1.08, Enum.EasingStyle.Quint), {BackgroundTransparency = 1})
HideTween:Play()
HideTween.Completed:Wait()
if RunService:IsStudio() then
warn("****************************")
warn("* LOADED ASSETS:")
end
for Index = 1, #Assets / 2 do
local Asset = Assets[Index]
ContentProvider:PreloadAsync({Asset})
Interface.Frame.Percent.Text = math.round(Index / #Assets * 100) .. "%"
if Bypass then
if tick() - SmesyTime > 6.4 then
Interface.Frame.Skip.Visible = true
UserInputService.MouseIconEnabled = true
local ButtonOne = TweenService:Create(Interface.Frame.Skip, TweenInfo.new(0.86, Enum.EasingStyle.Quint), {BackgroundTransparency = 0})
ButtonOne:Play()
local ButtonTwo = TweenService:Create(Interface.Frame.Skip, TweenInfo.new(0.86, Enum.EasingStyle.Quint), {TextTransparency = 0})
ButtonTwo:Play()
warn("[LOAD] Loading is taking a long time.")
Bypass = false
local CanClick = true
Interface.Frame.Skip.MouseButton1Click:Connect(function()
if CanClick then
warn("[LOAD] Did you really think I would make this work?")
CanClick = false
end
end)
Interface.Frame.Skip.MouseEnter:Connect(function()
script.Sounds.Enter:Play()
end)
Interface.Frame.Skip.MouseLeave:Connect(function()
script.Sounds.Enter:Play()
end)
end
end
if RunService:IsStudio() then
warn(Asset.Name)
end
end
if RunService:IsStudio() then
warn("****************************")
end
Interface.Frame.Percent.Text = math.round(#Assets / #Assets * 100) .. "%"
warn(string.format("[LOAD] Loaded game assets in " .. tostring(math.round(tick() - ThreeTick))) .. " seconds.")
Interface.Frame.Percent.TextColor3 = Color3.fromRGB(85, 255, 127)
task.wait(0.46)
warn("[LOAD] Game has loaded.")
Interface.Frame.Percent.Text = "Loaded"
Loading = false
if not Bypass then
UserInputService.MouseIconEnabled = false
end
task.wait(0.62)
local ProgressTween = TweenService:Create(Interface.Frame.Percent, TweenInfo.new(1.46, Enum.EasingStyle.Quint), {TextColor3 = Color3.fromRGB(255, 255, 255)})
ProgressTween:Play()
ProgressTween.Completed:Wait()
local HideTweenTwo = TweenService:Create(Interface.Hide, TweenInfo.new(1.12, Enum.EasingStyle.Quint), {BackgroundTransparency = 0})
HideTweenTwo:Play()
HideTweenTwo.Completed:Wait()
Interface.Frame.Visible = false
Interface.Developer.Visible = true
task.wait(0.46)
Interface.Developer.Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0))
local HideTweenName = TweenService:Create(Interface.Hide, TweenInfo.new(1.12, Enum.EasingStyle.Quint), {BackgroundTransparency = 1})
HideTweenName:Play()
task.wait(2.24)
local HideTweenFour = TweenService:Create(Interface.Hide, TweenInfo.new(1.84, Enum.EasingStyle.Quint), {BackgroundTransparency = 0})
HideTweenFour:Play()
HideTweenFour.Completed:Wait()
Interface.Developer.Visible = false
local HideTweenFive = TweenService:Create(Interface.Hide, TweenInfo.new(2.82, Enum.EasingStyle.Quint), {BackgroundTransparency = 1})
HideTweenFive:Play()
task.wait(0.86)
Interface.Hide.Visible = false
UserInputService.MouseIconEnabled = true
warn("[LOAD] You can finally play.")
local Module = require(Player.PlayerScripts:WaitForChild("PlayerModule"))
Module:GetControls():Enable()
end
SetupOne()
SetupTwo()