Sprint Script Error?!!!!

Here is the script.

//The Sprint script
if (Input.GetButtonDown("Shift")) {
    maxForwardSpeed = maxSprintSpeed ;
    maxSidewaysSpeed = maxSprintSpeed ;
    maxBackwardSpeed = 0 ;
}

if (Input.GetButtonUp("Shift")) {
    maxForwardSpeed : float = 20.0;
    maxSidewaysSpeed : float = 20.0
    maxBackwardsSpeed : float = 10.0

Any help will be very apreciated. Ty

The errors seem clear to me, and they are evident. the last two lines need “;” at the end. The second “if” doesn’t have the close bracket “}”.

I agree with BIG having read your errors that is exactly what needs to be done. close off the last two lines with the " ; " and then close of the argument with a " } "…and you should be good to go.

This is how your code should look

var maxForwardSpeed     : float = 20.0;
var maxSidewaysSpeed	: float = 20.0;
var maxBackwardsSpeed	: float = 10.0;
var maxSprintSpeed		: float = 30.0;

if (Input.GetButtonDown("Shift")) 
{
 maxForwardSpeed = maxSprintSpeed ;
 maxSidewaysSpeed = maxSprintSpeed ;
 maxBackwardSpeed = 0 ;
}

if (Input.GetButtonUp("Shift")) 
{
 maxForwardSpeed = maxForwardSpeed;
 maxSidewaysSpeed = maxSidewaysSpeed;
 maxBackwardsSpeed = maxBackwardsSpeed;
}

thats the basic setup for your char to run as far as the walk functions you have to script them out if you havent already.

thank you Durante Productions

here you go i updated it i messed up when i rewrote it sry.

var maxForwardSpeed     : float = 20.0;
var maxSidewaysSpeed    : float = 20.0;
var maxBackwardsSpeed   : float = 10.0;
var maxSprintSpeed   : float = 30.0;

if (Input.GetButtonDown("Shift")) 
{
 maxForwardSpeed = maxSprintSpeed ;
 maxSidewaysSpeed = maxSprintSpeed ;
 maxBackwardSpeed = 0 ;
}

if (Input.GetButtonUp("Shift")) 
{
 maxForwardSpeed = maxForwardSpeed;
 maxSidewaysSpeed = maxSidewaysSpeed;
 maxBackwardsSpeed = 0;
 maxSprintSpeed = 0;
}

I hope this helps.