So I have made a loading screen and I am trying to make it play music until it is done loading, im new to making loading screens, can someone help? This is my code for the loading screen;
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
local player = game.Players.LocalPlayer
local PlayerGui = player:WaitForChild(“PlayerGui”)
local song = Instance.new("Sound")
song.SoundId = "rbxassetid://urid"
song.Parent = script
local loadgui = script.Load:Clone()
loadgui.Parent = PlayerGui
if not game:IsLoaded() then
song:Play()
game.Loaded:Wait()
end
if not player.Character then
player.CharacterAdded:Wait()
end
loadgui:Destroy()
song:Destroy()