freeze position on click

I need help making my trampolines freeze after i click a cube. how my game works is theres two portals the start and end portal and your goal is to bounce a ball from one portal (the start portal) to the next (end portal) by bouncing it off of trampolines but my point is the trampolines are going to be lined up to where you want it then you click the cue releasing the ball but people could just guide the ball to the end portal so my goal is to make the trampolines freeze when they click the cube i’ve started a script already though that hasn’t been working out can you please give me my problem and a solution or a different script to work.

here’s the script:

var cube : Transform;
 
function OnMouseDown()
{
    transform.Translate (500,500,500);
}

function OnMouseUp()
{
cube.MovePoint2.enable = false;
}

What you want is:

function Update()
{

    if(Input.GetMouseButtonDown("0")){
        //code for trampolines to stop moving
        //this if statement is only triggered when the user clicks the mouse 0 button (left click by default)
    }
}

That code will check if the player is pressing the mouse button, and you can make it freeze the trampolines simply by stopping their movement.