Sound not playing at correct time

I’m trying to make a Camera Monitor that when you click it opens the Camera GUI and plays a sound. The GUI opens perfectly but the sound plays at the start of the game.

local MointorSound = script.Parent.Sound 

function onClick(click)
for i,v in pairs (script.Parent:GetChildren()) do
	if v.ClassName == "ScreenGui" then
		c = v:Clone()
		c.Parent = click.PlayerGui
	end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClick)
MointorSound:Play()

Change to:

local MointorSound = script.Parent.Sound 

function onClick(click)
  MointorSound:Play()
  for i,v in pairs (script.Parent:GetChildren()) do
    if v.ClassName == "ScreenGui" then
      c = v:Clone()
      c.Parent = click.PlayerGui
    end
  end
end
script.Parent.ClickDetector.MouseClick:connect(onClick)

Ok, I realised what I did wrong. Thanks!