Audio instance issues

I’ve been putting the finishing touches on the lighting system for my Backrooms game by adding sounds to the lights flickering, but for some reason I keep getting this error.


Here is the relevant portion of my code (The rest is just functions for light toggling and some variables that has no impact on the sound not working):

while blackoutActive == false do
	print("Random flicker function engaged")
	selectedLight = math.random(1, 255)
	task.wait(math.random(5, 17))
	print("Flicker event begining")
	fsound = Instance.new("Sound")
	fsound.Parent = lights[selectedLight]
	fsound.SoundId = "rbxassetid://15558806269"
	chance = math.random(1, 61)
	fsound.Playing = true
	for i = 1, math.random(3, 10) do
		lightOff(selectedLight)
		task.wait(0.05)
		lightOn(selectedLight)
		task.wait(0.05)
		print("Flicker loop", i)
	end
	fsound.Playing = false
	fsound:Destroy()
	print("Blackout chance: ", chance)
	if chance == 60 then
		blackout()
		task.wait(math.random(30, 360))
		endBlackout()
	end
end

Does anyone know what’s wrong?

Sounds like an issue with incorrectly fetched permissions. Whenever I’ve run into this problem, simply manually adding the experience’s UniverseId and authorizing it via the Sound’s Configure Permissions page does the trick.

Give it a shot. Hope that helps.

Already did that, changed nothing.

have you tried restarting roblox studio? I was just getting this issue and restarting worked lol

I don’t notice anything immediately wrong with your implementation. Are you sure you’re not forgetting to hit the “Save Changes” button after adding your UniverseId on the permissions configurator?

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