RaweTrip
  • Welcome
  • Official Discord
  • Useful information
    • πŸ”ŒFor beginners
    • β™ŸοΈCommon knowledge
    • πŸ“šExamples
      • βš™οΈTab system
      • βš™οΈUI Interaction
      • βš™οΈClantag
      • βš™οΈWireframe smoke
  • documentation
    • ⛓️Common
      • πŸ“žCallbacks list
    • βš™οΈVariables
      • πŸ‘€esp
      • πŸ“œplist
      • πŸ”«weapon
      • ⚑vector
      • 🎨color
      • πŸŽ“cheat
      • πŸ’»ui
      • πŸ™οΈrender
      • πŸšΆβ€β™‚οΈentity
      • 🌎globalvars
      • πŸ› οΈengine
      • πŸ”©utils
      • πŸ–₯️console
      • πŸ”‘base64
      • πŸ“ bit
      • πŸ—ƒοΈfile
      • πŸ“Άhttp
      • βœ‰οΈchat
      • 〽️animate
      • 🧱materials
      • πŸ”§steam
      • ✈️trace
      • πŸ”—interfaces
        • πŸ’‘ieffects
        • 🧬precache
        • πŸ’³model_info
    • πŸ”’Enumerations
      • 🎞️enum_frames
Powered by GitBook
On this page
  1. documentation
  2. Variables

vector

Variables:

vector(x: number, y: number, z: number)

Name
Type
Description

x

number

-

y

number

-

z

number

-

How to use vector:

--> Vectors
local new_vec = vector(255, 255, 255)
local sec_vec = vector(2000, 100, 100)

--> Length
local new_vec_length = new_vec:length()

--> Distance
local dist = new_vec:dist_to(sec_vec)

Functions:

:length

vec_object:length(): number

Returns the length of the vector.

:length_sqr

vec_object:length_sqr(): number

Returns the squared length of the vector.

:length_2d

vec_object:length_2d(): number

Returns the length of the vector in two dimensions, without the Z axis.

:length_2d_sqr

vec_object:length_2d_sqr(): number

Returns the squared length of the vectors x and y value.

:is_zero

vec_object:is_zero(): boolean

Returns true, if all coordinates of the vector are zero.

:is_valid

vec_object:is_valid(): boolean

Returns true, if the vector is valid.

:zero

vec_object:zero(): vector

Sets zero values to the vector.

:dist_to

vec_object:dist_to(vec_end: vector): number

Name
Type
Description

vec_end

vector

The vector to get the distance to

Returns the distance between the two given vectors.

:dist_to_sqr

vec_object:dist_to_sqr(vec_end: vector): number

Name
Type
Description

vec_end

vector

The vector to get the squared distance to

Returns the squared distance to another vector.

:cross_product

vec_object:cross_product(vec_end: vector): vector

Name
Type
Description

vec_end

vector

The vector to calculate the cross product with

Returns the cross product of two given vectors.

:normalize

vec_object:normalize(): number

Normalizes the vector and returns the length of the vector.

vector_2d(x: number, y: number)

Name
Type
Description

x

number

-

y

number

-

How to use vector_2d:

--> Vectors
local new_vec = vector_2d(255, 255)

--> Output info
cheat.notify(new_vec.x .. new_vec.y)

vector_4d(x: number, y: number, z: number, w: number)

Name
Type
Description

x

number

-

y

number

-

z

number

-

w

number

-

How to use vector_4d:

--> Vectors 
local new_vec = vector_4d(255, 255, 255, 255)

--> Output info 
cheat.notify(new_vec.x .. new_vec.y .. new_vec.z .. new_vec.w)
PreviousweaponNextcolor

Last updated 2 years ago

βš™οΈ
⚑