Event acting weird

Hey there, I create a clicking event but it is not working, I double checked to see if the names were there and if there were no typos, none. There are also no errors. Here is the script:

plr.PlayerGui.MainGui.Pages.ShopFrame.RanksGrid.Scroller.Noob.MouseButton1Click:Connect(function()

	local sound = Instance.new("Sound",plr)
	sound.SoundId = ClickSound
	sound:Play()
	debris:AddItem(sound, 5)
	CurrentRank.ItemName.Text = "Noob"
	CurrentRank.ItemPrice.Text = "Price: "..0
	CurrentRank.ItemStats.Text = "Boost: ".."x"..1
	CurrentRank.ImageLabel.Image = "rbxassetid://5696343687"



end)

Exactly which part of your code isn’t working?

All of it, it just is not working at all.

You’re going to need to provide a whole lot more information then. I don’t know what “all of it” means, nor what your current set up looks like (such as where the script is, what type of script it is and so on). The context is far too vague especially for an issue where you supposedly receive no errors.

Usually when using sounds its best to load them before playing.

I dont really recommend making the sound right before playing as if you are loading the sound that can result in a delay beforr it actually plays.

You would most likely want to have the sounds stored and preloaded somewhere so you avoid the delay while having it loaded.

I figured it out, I just had to put it in a loop.