game

Interact with Roblox.

When using the Game API the info is returned directly from memory. It's strongly advised that these functions are never called within the paint callback. Calling these functions within the paint callback, may cause unexpected performance drops. Querying the game's memory is expensive, and doing it every frame is not optimal.

Functions:

Data Model

game.get_data_model();

Returns an instance. Every place is represented by a data model, a hierarchy of objects that describe everything about the place.

Camera Position

game.get_camera_pos();

returns the position of the camera as x,y, z

Place ID

game.get_place_id();

Returns the game's place id.

Get Workspace

game.get_workspace()

Returns an Instance that's class is Workspace.

Get Players

game.get_players();

Returns an Instance that's class is Players.

Get Local Player

game.get_local_player();

Returns an instance to the local player.

Is Focused

game.is_focused()

Returns true if the game is in focus.

Methods:

These can be used on instances, anything in the game is considered an instance automatically. There are different type of instances (ex. Part, MeshPart, Player, Workspace, Camera, etc...)

Get Children

instance:get_children()

Returns an array containing all of the instance's direct children.

Get Descendants

instance:get_descendants()

Returns an array that contains all of the descendants of that object.

Get Parent

instance:get_parent()

Returns a parent instance to the provided instance.

Get Class Name

instance:get_class_name()

Returns the class name of instance.

Get Name

instance:get_name()

Returns the name of the instance.

Set Name

instance:set_name(string: name)

Sets the name of the instance.

Find First Child

instance:find_first_child(string: name)

Returns a child instance with the provided name.

Find First Child Of Class

instance:find_first_child_of_class(string: class_name)

Returns a child instance with the provided class name.

Get Button Position

instance:get_button_position()

Returns two float values of the position.

Get Button Size

instance:get_button_size()

Returns two float values of the size of the instance.

Set Button Size

instance:set_button_size(vector: size)

Takes a vector as an argument and sets the size of the button. The vector should be formatted as (sizex, sizey, 0)

Is A

instance:is_a(string: class_name)

Returns true if the instance is the compared class name.

Get Proximity Prompt Hold Duration

instance:get_hold_duration()

Returns float value of the hold duration of a Proximity Prompt.

Set Proximity Prompt Hold Duration

instance:set_hold_duration(float: duration)

Sets the hold duration of a Proxmity Prompt to a float value.

Get Frame "Visible" Flag

instance:get_frame_visible()

Returns an int value. 256 = Visible, 0 = Not Visible.

Get TextLabel Value

instance:get_textlabel_value()

Returns string value from the TextLabel.

Get String Value

instance:get_string_value()

Returns string value.

Set String Value

instance:set_string_value(string)

sets the value of the instance to a string.

Get Number Value

instance:get_number_value()

Returns number value.

Get Int Value

instance:get_int_value()

Returns integer value.

Set Number Value

instance:set_number_value(double: value)

Set Int Value

instance:set_int_value(int: value)

Part & Mesh Part Methods:

Get Position

instance:get_position()

Returns the position as 3 floats

Set Position

instance:set_position()

Takes in a vector and sets the position of an instance

Get Velocity

instance:get_velocity()

Returns the velocity as (x, y, z). You can create a vector instance and get the length of it, to get the value as an number.

Get Look Vector

instance:get_look_vector()

Returns the look vector as 3 floats.

Set Look Vector

instance:set_look_vector(vector: value)

Takes a vector as an argument and writes to the Look Vector inside CFrame

Get Color

instance:get_color()

Returns an integer value of color for the instance

Set Color

instance:set_color(int: value)

Sets the color of the instance to the integer value. Here are some colors we went ahead and reversed for you:

12517631 - hot pink 0-black 65535 - yellow 255 - red 16777215 - white 16715423 - magenta 15826715 - electric blue 454912 - lime green 2588109 - orange

Get Size

instance:get_size()

Returns x, y, z of the size of the instance

Set Size

instance:set_size(vector: x,y,z)

Overrides the instances size with the values passed. Takes a vector

Get Material

instance:get_material()

Returns an integer value.

Set Material

instance:set_material(int: value)

Overrides the instances material with the selected material.

For a list of Materials, check here: https://pastebin.com/H0X9Nz2c

Get Mesh ID

instance:get_mesh_id()

Returns the mesh id as a string.

Set Mesh ID

instance:set_mesh_id(string: mesh)

Sets the mesh id of a part.

Set Highlight Occlusion

instance:set_highlight_ontop()

Sets the instance (a highlight) to AlwaysOnTop

Set Highlight Transparency

instance:set_highlight_transparency(float: value)

Takes a float as an arg and sets the instance's tranparency.

Humanoid Methods:

Get Move Direction

instance:get_move_direction()

Returns the move direction as x, y, z.

Get Health

instance:get_health()

Returns the health value as a number.

Get Max Health

instance:get_max_health()

Returns the maximum health value as a number.

Player Methods:

Get Character

instance:get_character()

Returns the character of that instance.

Get Team

instance:get_team()

Returns the team name.

Get User ID

instance:get_user_id()

Returns the user id as a number.

Last updated