Issue with Loading Screen Script: Unable to Find Sound Effects Folder

I’m encountering an issue with my loading screen script where it’s unable to find the sound effects folder in ServerStorage. Below is a summary of my current script setup:

--[Services]--
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")

--[Player Instances]--
local Player = Players.LocalPlayer
local PlayerGui = Player.PlayerGui

--[Loading ScreenGui Hierarchy]--
local loadingUI = PlayerGui:WaitForChild("loadingUI")
local fr_backgroundFrame = loadingUI:WaitForChild("fr_backgroundFrame")
local imglbl_alternateText = fr_backgroundFrame:WaitForChild("imglbl_alternateText")
local imglbl_projectLogo = fr_backgroundFrame:WaitForChild("imglbl_projectLogo")
local tl_quickDialog = fr_backgroundFrame:WaitForChild("tl_quickDialog")

--[Function to Load Sound Effects]--
local function loadSoundEffects()
	local sfx_gameSoundEffect = game.ServerStorage:FindFirstChild("sfx_gameSoundEffect")
	if not sfx_gameSoundEffect then
		error("sfx_gameSoundEffect folder not found in ServerStorage!")
		return false
	end

	local sfx_djDiscStopMemeMP3 = sfx_gameSoundEffect:FindFirstChild("sfx_djDiscStopMemeMP3")
	local sfx_fartSoundMemeMP3 = sfx_gameSoundEffect:FindFirstChild("sfx_fartSoundMemeMP3")

	if not sfx_djDiscStopMemeMP3 or not sfx_fartSoundMemeMP3 then
		error("One or more sound effects not found in sfx_gameSoundEffect folder!")
		return false
	end

	print("Loaded sound effects successfully.")
	return true
end

--[Function to Play Sound]--
local function playSound(sound)
	if not sound then
		return
	end

	local soundClone = sound:Clone()
	soundClone.Parent = fr_backgroundFrame
	soundClone:Play()
	game.Debris:AddItem(soundClone, soundClone.TimeLength)
end

--[Function to Show Dialog]--
local function showDialog(text, duration)
	tl_quickDialog.Text = text
	wait(duration)
end

--[Function to Fade In Logo]--
local function fadeInLogo()
	local logo = imglbl_projectLogo
	logo.ImageTransparency = 1

	local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1, true)
	local transparencyTween = TweenService:Create(logo, tweenInfo, {ImageTransparency = 0})
	transparencyTween:Play()
end

--[Function to Start Loading Screen Sequence]--
local function startLoadingScreen()
	-- Load sound effects
	local success = loadSoundEffects()
	if not success then
		warn("Failed to load sound effects. Loading screen may not function correctly.")
		return
	end

	-- Fade in Rainbow Friends logo
	fadeInLogo()

	-- Play DJ disc stopping sound
	playSound(sfx_djDiscStopMemeMP3)

	-- Show dialogues with delays
	showDialog("Wait, this doesn't seem right...", 7)
	showDialog("We already have a game with this name-", 6)
	showDialog("Quick- Change to something else before we get any DMCA!", 8)

	-- Play fart sound effect
	playSound(sfx_fartSoundMemeMP3)

	-- Show Classic Edition image and final text
	imglbl_alternateText.Visible = true
	tl_quickDialog.Visible = true
	tl_quickDialog.Text = "Ah, much better!"
	wait(4)

	-- Cleanup
	imglbl_projectLogo.Visible = false
	tl_quickDialog.Visible = false
end

-- Start the loading screen sequence
startLoadingScreen()

Issue: My script is designed to display a loading screen with animations, sound effects, and dialogues. However, it consistently raises the error:

Players.JuanGamerPlayz_RBLX.PlayerGui.loadingUI.ls_loadingScreen:20: sfx_projectSoundEffect folder not found in ServerStorage!

This error indicates that the script is unable to locate the sfx_projectSoundEffect folder in ServerStorage.

What I’ve Tried:

  • I’ve verified the folder structure in ServerStorage and ensured that sfx_projectSoundEffect exists with the correct name and casing.
  • I’ve reviewed similar scripts and documentation to confirm the proper usage of FindFirstChild and WaitForChild functions.

image

image

oops
it appears to be named sfx_gameSoundEffect, not project

2 Likes

Whoops, I inserted the outdated code… Let me change that up!

1 Like

Your GUI code is running on the client, which is (correctly) unable to find a server-side folder.

Try moving the sound effects folder to ReplicatedStorage.

2 Likes

Changed the code to the recent version!

I will try and change the code from that part of Server → ReplicatedStorage… One second!

Something else you can try is sending the folder to the client, but it’s probably better to just move everything to ReplicatedStorage and let Roblox handle replicating the needed assets.

Some more information on why clients can’t read Server folders:

1 Like

Okay, I have replaced the folders to ReplicatedStorage and changed a bit of the code and it worked! I didn’t know that I needed to just pass there and let the engine handle the necessary… Likewise, thanks for the help! :blue_heart:

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.