Sound Won't Play

The sound for my game does not play and there are no errors. Heres my code:

local sound1 = 1842967125
local sound2 = 1848183670
local sound3 = 1840012649
local sound4 = 1839304990
local sound5 = 1844030471

while true do
	wait()
	musicSoundId = "rbxassetid://"..sound1
	musicSoundId:Play()
	musicSoundId.Ended:wait()
	
	musicSoundId = "rbxassetid://"..sound2
	musicSoundId:Play()
	musicSoundId.Ended:wait()
	
	musicSoundId = "rbxassetid://"..sound3
	musicSoundId:Play()
	musicSoundId.Ended:wait()
	
	musicSoundId = "rbxassetid://"..sound4
	musicSoundId:Play()
	musicSoundId.Ended:wait()
	
	musicSoundId = "rbxassetid://"..sound5
	musicSoundId:Play()
	musicSoundId.Ended:wait()
end

Thanks for reading!

2 Likes

I believe you need to make a sound instance and then attach those values to it

1 Like

Add this to your code and make it change the SoundId property instead of the Instance.

local YourVariableName = Instance.new("Sound", workspace) --Creates a Sound in workspace
--How to change the ID
YourVariableName.SoundId = "rbxassetid://1234567890"
3 Likes

If you’re updating any properties other than the parent upon creation, do not use the parent argument.

1 Like