Task buttons - NotMyWing/GarrysModAmongUs GitHub Wiki

Task buttons are the primary way with which players interact with your map. They represent the point players must interact with in order to bring up the task completion UI. In GMod Among Us, there are two types of task buttons entities: func_task_button (which are made of world brushes), and prop_task_button (which use a world model). Which you use will depend on which stage of mapping you're on; it's probably best to start out with func_task_button in the early stages of mapping, and move on to prop_task_buttons when you're ready to prettify your map. Beyond having a model, both entities have the same structure.

Keyvalues

Task name (taskname) <string>

The internal name of the task this button activates. The task name to use is simply the name of the MoonScript file which implements it. See the tasks directory for a list of available tasks.

Area name (areaname) <string>

The internal (ie, non-localized) name of the area this button is in. Typically in the form of area.areaName. See the default language file for all included area names. See Localization for more details on localization strings.

Custom data (customdata) <string>

Any custom data the task needs to know about this button. For example, fuelEngines' fuel canister should have a custom data of barrel, the first engine button should have pipe1, and the second engine button should have pipe2.

Inputs

N/A

Outputs

OnTaskUse

Called when a player starts doing the task using this button. Only fires if au_tasks_enable_visual is 1.

OnTaskCancel

Called when a player cancels (ie, closes the UI without completing) the task using this button. Only fires if au_tasks_enable_visual is 1.

OnTaskAdvance

Called when a player finishes a step of (but not when they complete) a multi-part task using this button. Only fires if au_tasks_enable_visual is 1.

OnTaskComplete

Called when a player completes the tank using this button. Only fires if au_tasks_enable_visual is 1.

External resources

⚠️ **GitHub.com Fallback** ⚠️