Loading Screen Audio

While my loading screen is loading I have some background music which works however I want another short audio to play afterwords. I suck at scripting and can’t seem to get it to work could I please have some help.

local gui = game.Players.LocalPlayer.PlayerGui:WaitForChild("Loading GUI")
local RelicatedFirst = script.Parent
local audioId = 1837005317
local AudioID = 1836996067
RelicatedFirst:RemoveDefaultLoadingScreen()
gui.Enabled=true
local audioObject = Instance.new("Sound", gui)
audioObject.SoundId = "rbxassetid://"..audioId
audioObject:Play()

wait(20)
if not game:IsLoaded() then
	game.Loaded:Wait()
end
gui.Enabled = false
audioObject:Stop()

local audioObject = Instance.new("Sound", gui)
audioObject.AudioID = "rbxassetid://"..audioId
audioObject:Play()

wait(5)
audioObject:Stop()

This is the part that doesn’t work

The local values are probably getting mixed up, perhaps you could try changing a name of one of them? (AudioId Value thingys)

I just tried it sadly it doesn’t work

Is there any error(s) that appear in the console or no?

Change the part not working to this instead:

local audioObject = Instance.new("Sound", gui)
audioObject.SoundId = "rbxassetid://"..AudioID
audioObject:Play()

wait(5)
audioObject:Stop()

No, can’t see any, someone found the problem thx for your help

1 Like