Garry's Mod Wiki

Vector:Mul

  Vector:Mul( number multiplier )

Description

Scales the vector by the given number (that means x, y and z are multiplied by that value), a Vector (X, Y, and Z of each vector are multiplied) or a VMatrix (Transforms the vector by the matrix's rotation/translation).

Arguments

1 number multiplier
The value to scale the vector with.

Example

Scales a vector by 250.

a = Vector(1, 1, 1) a:Mul(250) print(a)
Output:
250 250 250

Example

If you don't want to set your vector to the result, and just return a new vector as the result. You can use a ' * ' operator to multiply a vector with a scalar.

a = Vector(1, 1, 1) print(a*250)
Output:
250 250 250