For some reason, my loading screen UI keeps re-appearing when the player resets/respawns. This wasn’t an issue before, ResetOnSpawn
was disabled and the loading screen didn’t appear when the player died.
However, all of a sudden it has begun re-appearing again. ResetOnSpawn
is currently Disabled yet still re-appears on death, this is the script inside of it.
local holder = script.Parent.Holder
script.Parent.Enabled = true
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
script.IntroMusic:Play()
local TweenService = game:GetService("TweenService")
local function start()
local numAssets = #game:GetDescendants()
local assetsLoaded = 0
local startTime = tick()
repeat
local elapsedTime = tick() - startTime
local progress = math.min(elapsedTime / 6, 1)
holder.BarFrame.Bar.Size = UDim2.new(progress, 0, 1, 0)
wait()
until elapsedTime >= 6
holder:TweenPosition(UDim2.new(0.5, 0, -1.5, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 1)
local volume = 1
while volume > 0 do
volume = math.max(volume - 0.1, 0)
script.IntroMusic.Volume = volume
wait(1)
end
script.IntroMusic:Stop()
end
start()
Any help would be appreciated, thanks.