script for checking a tick box and set value [closed]

I have a tick box in cell A7. I write this script but I think it is working correctly. The script should check the tick box if it is ticked then the scriot set the valllue (P) in the range A8:A15). If it is unticked then nothing happens in range (A8:A15). could you please help me to correct this script because I am beginner in google Apps script?

link to spreadsheet

function checkandsetvalue() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName('EXAMPLE1');
  var valueA1 = sheet.getRange('A7').getValue();
  if (valueA1 = true) {
    sheet.getRange('C7').setValue(valueA1);
  }
}