Garry's Mod Wiki

Revision Difference

Vector:Mul#552225

<function name="Mul" parent="Vector" type="classfunc"> <description>Scales the vector by the given number (that means x, y and z are multiplied by that value) or Vector.</description> <description>Scales the vector by the given <page>number</page> (that means x, y and z are multiplied by that value), a <page>Vector</page> (X, Y, and Z of each vector are multiplied) or a <page>VMatrix</page> (Transforms the vector by the matrix's rotation/translation).</description> <realm>Shared and Menu</realm> <args> <arg name="multiplier" type="number">The value to scale the vector with.</arg> </args> </function> <example> <description>Scales a vector by 250.</description> <code> a = Vector(1, 1, 1) a:Mul(250) print(a) </code> <output> ``` 250 250 250 ``` </output> </example> <example> <description>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.</description> <code> a = Vector(1, 1, 1) print(a*250) </code> <output> ``` 250 250 250 ``` </output> </example>