The script work one time then it's stop working

The script idea is to check if the owner of this spot is the player who clicked on the part then do the actions if yes or no but it’s only work one time then it’s stop working

local main = script.Parent.Parent
main.ClickDetector.MouseClick:Connect(function(player)
	if main.Parent.Parent.Parent.SurfaceGui.PlayerName.Text == player.Name then
		player:WaitForChild("PlayerGui").PCGui.Enabled = true
	else
		print("that isn't your spot")
	end
end)

ok I fixed it

aaaaaaaaaaaaaaaaa