Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

"WorkspaceSounds is not a valid member of workspace" when it is? (Solved)

I looked through all of my scripts and one that sets the room area you're in was destroying the actual folder rather than one of the sound objects I wanted to get rid of, the reason it only seemed to do it on a roblox game server was because I wasn't going far enough into the map to touch the part that changes the room value


I have a folder located in workspace which holds a bunch of sound items that I use whenever I want a sound to be played that can be heard across the map. Although a strange bug seems to occur; whenever I call on an item in the folder (whether it be from a local or server script) the game prints an error saying that the folder doesn't exist. When I check for the folder before calling on an item in it, it says it exists.

This bug only happens on a Roblox game server, not in studio or a studio server. There's no scripts that I have in game that do anything but play and stop sound objects located within the folder. Does anyone know what could be causing this?

Edit: When I play an item in the folder using the in-game console, the bug doesn't happen. It only seems to happen when I try to reference a sound in the folder with a script.

Edit2: Here is one of the first scripts that calls upon a sound object (I've noted where I do so in the script)

db = false

script.Parent.Touched:Connect(function(part)
	if part.Parent:FindFirstChild("Humanoid") then
		if not db then db = true
		local p = game.Players:GetPlayerFromCharacter(part.Parent)
		p.ChangingPartValues.PeanutAppeared.Value = false
		game.ReplicatedStorage.Events.PeanutAppear:FireAllClients()
		script.Parent.Parent.Scp173AppearBrick.SCP173Appear.Disabled = true
		
		script.Parent.TunnelBurst:Play() 
		wait(3.75)
		script.Parent.Appear:Play()
		
		workspace.RegenableMapParts.SCPs["SCP-173"]:MoveTo(Vector3.new(99.2, 4.181, 82.6))
		local cframe = workspace.RegenableMapParts.SCPs["SCP-173"].PrimaryPart.CFrame 
		workspace.RegenableMapParts.SCPs["SCP-173"]:SetPrimaryPartCFrame(cframe * CFrame.Angles(0, math.rad(-90), 0))
		workspace.RegenableMapParts.SCPs["SCP-173"].Main.Spawned.Value = true
		
		wait(5.5)
		workspace.WorkspaceSounds.SCPIntro:Play() -- call on sound (errors)
		wait(64.7)
		workspace.WorkspaceSounds.SCPIntro_2:Play() -- call on sound (errors)
		wait(1)
		script.Parent.Parent:Destroy()
		end
	end
end)

Edit3: I've noticed that other sounds in the folder actually does work when called upon by both local and server scripts, it seems that the only sound that causes errors is when I call upon "SCPIntro" as seen above. For context, I call it from a server script located in workspace.

5 comments

0

Show ur script plz

0

What line is having the error?

0

Line 21

0

I recommend adding a picture of your workspace with the folder. You most likely spelt it wrong.

0

I check through all the scripts and it's spelt right. Even if it wasn't, it'd be erroring out in studio too, for some reason it only doesn't work in Roblox game servers.

1 answer

could you show the picture of the explorer? also it maybe that you spelt it wrong.

This discussion is preserved as it was. New answers, comments, and votes are closed.