i have a loading screen, yay!
but it doesn’t really work, no!
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
local contentProvider = game:GetService("ContentProvider")
local rStorage = game:GetService("ReplicatedStorage")
local tService = game:GetService("TweenService")
local tweenParameters = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out
)
-- Path to bindable event;
local events = rStorage:WaitForChild("Events")
local bindableEvents = events:WaitForChild("Bindable")
-- Event;
local menuOnLoad = bindableEvents:WaitForChild("MenuOnLoad")
local ui = script:WaitForChild("LoadingScreen"):Clone()
local assets = game:GetDescendants()
local plr = game:GetService("Players").LocalPlayer
plr.CameraMode = Enum.CameraMode.LockFirstPerson
local plrGui = plr.PlayerGui
ui.Parent = plrGui
local quotes = ui:WaitForChild("Quotes")
local frame = ui:WaitForChild("Frame")
local icon = ui:WaitForChild("Icon")
local quoteChances = {
["I rebel, therefore I exist."] = 10,
["Question everything."] = 10,
["Live fast, die young."] = 10,
["We are all mad here."] = 10,
["I am the storm."] = 9,
["Normal is boring."] = 10,
["Reality is a prison."] = 10,
["Die with memories, not dreams."] = 10,
["Embrace the chaos."] = 10,
["Silence is the loudest scream."] = 10,
["Peepee Poopoo."] = 1
}
function SelectQuote()
local totalChance = 0
for _,chance in pairs(quoteChances) do
totalChance += chance
end
local rng = math.random(1,totalChance)
for quote, chance in pairs(quoteChances) do
rng -= chance
if rng <= 0 then
print(quote) -- this does NOT print, and the text stays as "Label"
return quote
end
end
end
if not game:IsLoaded() then
plr:SetAttribute("Loaded", false)
coroutine.wrap(function()
while not game:IsLoaded() do
quotes.Text = SelectQuote()
task.wait(5)
end
end)()
local success, err = pcall(function()
contentProvider:PreloadAsync(assets)
end)
if not success then
warn("Failed to preload asset: " .. err)
end
end
task.wait(1)
plrGui:WaitForChild("MainMenu").Enabled = true
local frameTween = tService:Create(frame, tweenParameters, {BackgroundTransparency = 1})
local iconTween =tService:Create(icon, tweenParameters, {ImageTransparency = 1})
local quotesTween = tService:Create(quotes, tweenParameters, {TextTransparency = 1})
frameTween:Play()
iconTween:Play()
quotesTween:Play()
frameTween.Completed:Wait()
ui:Destroy()
plr:SetAttribute("Loaded", true)
menuOnLoad:Fire()
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)