juju scripting documentation
  • Scripting Documentation
  • Creating a script
    • Necessities
      • Example Script
      • Example Script 2
      • Example Script 3
  • Documentation
    • Elements
      • Element Properties
      • Element API
    • Utility Functions
  • Da Hood
    • Signals
    • Functions
Powered by GitBook
On this page
  1. Documentation

Utility Functions

Here is a list of the available functions used to assist script developers

juju.on_unload(callback: Function)
Argument
Type
Description

callback

Function

This function is called when the addon is unloaded

juju.create_connection(signal: RBXScriptConnection or Table, callback: Function)
Argument
Type
Description

signal

RBXScriptSignal or table (custom signals)

The signal to connect the callback to

callback

Function

The function to connect to the signal

Return Type
Description

RBXScriptSignal or table (custom signals)

Signal object, can use :Disconnect etc

juju.find_element(section: String, feature: String)
Return Type
Description

Table

An element, like given from create_element

If you are attempting to access a feature within an element's settings, use the element/feature as the parent name instead of the section. Also, this is an expensive function; it is recommended to only use this during initialization. Example: juju.find_element("ragebot", "void hide")

juju.get_flags()
Return Type
Description

Table

A table holding the names of all juju flags

juju.get_flag(flag: String)
Return Type
Description

Any

The value of the flag given

juju.set_flag(flag: String, value: Any)
Return Type
Description

None

N/A

juju.get_signals()
Return Type
Description

Table

A table holding the names of all juju signals

juju.get_signal(name: String)
Return Type
Description

Table / RBXScriptSignal

The found signal

This, along with some other functions may not error if the function failed to complete. If the signal does not exist, this function will not error. It is recommended you complete these sort of checks your self.

juju.create_notification(text: String, type: Number, time: Number)
Argument
Type
Description

text

String

The text that will be displayed over the notification

type

Number

The type of notification being sent, 1 = Success, 2 = Alert, 3 = Fail

time

Number

The amount of time the notification is on screen (0.5 - 7 seconds only)

juju.set_player_status(player: Instance (Player), status: Number)
Argument
Type
Description

player

Instance (Player)

The player that will have their status set

status

Number

The status the player is being set as, 1 = Neutral, 2 = Friendly, 3 = Enemy

juju.get_player_status(player: Instance(Player))
Return Type
Description

Number

The player's current status, 1 = Neutral, 2 = Friendly, 3 = Enemy

juju.get_active_keybinds()
Return Type
Description

Table

Example return result: {["silent aim"] = true, ["prediction"] = 1948.6923814}

juju.load_config(name: String)
Argument
Description

name

The name of the config, without the extension. default.cfg -> juju.load_config("default")

PreviousElement APINextSignals

Last updated 24 days ago