Sound error issue

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.MainShop.Visible = not script.Parent.Parent.MainShop.Visible
	local ClickSound = game.ReplicatedStorage.Click
	local cs = game:GetService("ContentProvider")
	cs:PreloadAsync(ClickSound)
	
	ClickSound:Play()
end)
-- error 
  14:42:21.872 - Unable to cast to Array

How to fix this?

:PreloadAsync takes a table of ID’s not a single instance.

Perhaps you meant cs:PreloadAsync({ ClickSound.SoundId }) ?

1 Like