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.

Silent Aim

silent_aim(float: x, float: y)

Takes in the screen position or wherever you want to silent aim. Ex. Player screen position.

Player Whitelist

player_whitelist(string: player_name)

Whitelists/Unwhitelists the provided player's name.

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 Address

instance:get_address()

Returns the address of the instance as a string.

Get Children

instance:get_children()

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

Get Attribute

instance:get_attribute(string: attribute_name)

Takes the attribute's name as an argument, it then returns a string of the attribute's value.

An attribute of: RandomAttribute Melatonin

And a usage of get_attribute("RandomAttribute"), would return the string "Melatonin".

Get All Attributes

instance:get_all_attributes()

Returns a table containing the instance's available attributes.

Attribute Data
Description

name

Returns the display name of the attribute.

type

Returns the data type of the attribute. bool Vector2 Color3 Vector3 double float

value

Returns the actual value stored for that attribute.

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 Proximity Prompt Max Activation Distance

instance:get_activation_distance()

Returns float value of the max activation distance.

Set Proximity Prompt Max Activation Distance

instance:set_activation_distance(float: duration)

Sets the Max Activation Distance of a Proximity Prompt to a float value.

Get Proximity Prompt Action Text

instance:get_proximity_action_text()

Returns the Action Text of a proximity prompt as a string.

Get Proximity Prompt Exclusivity

instance:get_proximity_exclusivity()

Returns a string of the Proximity Prompt's Exclusivity. Example: "OnePerButton" or "AlwaysShow"

Set Proximity Prompt Exclusivity

instance:set_proximity_exclusivity(string: exclusivity)

Set the exclusivity of a Proximity Prompt. Takes a string such as: "OnePerButton" "AlwaysShow" "OneGlobally"

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.

Set TextLabel Value

instance:set_textlabel_value(string: value)

Sets the string value from the TextLabel.

Get Vector3 Value

instance:get_vector_value()

Returns 3 floats (x, y ,z)

Set Vector3 Value

instance:set_vector_value(float: x, float: y, float: z)

Sets the value of a Vector3 instance, takes 3 floats as parameters.

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 Object Value

instance:get_objectvalue()

Returns the instance of whatever object is being held.

Set Object Value

instance:set_objectvalue(Instance: object)

Sets the instance of whatever object is being held.

Get Int Value

instance:get_int_value()

Returns integer value.

Get Bool Value

instance:get_bool_value()

Returns boolean value.

Set Bool Value

instance:set_bool_value(bool: value)

Sets a boolean 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

Get Rotation

instance:get_rotation()

Returns the rotation of the specified part as matrix3 struct. Here's an example of it's useage:

Set Position

instance:set_position()

Takes in a vector and sets the position of an instance

Get Bone Position

instance:get_bone_position()

Returns the position of a Bone instance as 3 floats

Get Velocity

instance:get_velocity()

Returns the velocity as 3 floats.

Set Velocity

instance:set_velocity(float: x, float: y, float: z)

Sets the velocity of an instance based on 3 floats provided as parameters.

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 Up Vector

instance:get_up_vector()

Returns the up vector as 3 floats.

Set Up Vector

instance:set_up_vector(vector: value)

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

Get Right Vector

instance:get_right_vector()

Returns the right vector as 3 floats.

Set Right Vector

instance:set_right_vector(vector: value)

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

Get Color

instance:get_color()

Returns 3 int values (RGB) of the instance's color.

Set Color

instance:set_color(int: red, int: green, int: blue)

Sets the color of the instance.

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()

Return a string of the Instance's Material. Ex. "ForceField"

Set Material

instance:set_material(string: material)

Overrides the instances material with the selected material.

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

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.

Get Texture ID

instance:get_textureid()

Returns the texture id as a string. This is intended for MeshParts.

Get Decal Texture ID

instance:get_decal_textureid()

Returns the texture id as a string. This is intended for Decals.

Get SpecialMesh Texture ID

instance:get_textureid_specialmesh()

Returns the texture id as a string. This is intended for SpecialMesh instances.

Get SoundID

instance:get_soundid()

Returns the soundid as a string.

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.

Get Reflectance

instance:get_reflectance()

Returns the reflectance of an instance as a float.

Set Reflectance

instance:set_reflectance(float: reflectance)

Sets the reflectance of an instance as a float.

Get Transparency

instance:get_transparency()

Returns the transparency of an instance as a float.

Set Transparency

instance:set_transparency(float: transparency)

Sets the transparency of an instance.

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.

Set Character

instance:set_character(Instance: character)

Sets 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