SlashCo Wiki

SlashCo.UpdateObjective

  SlashCo.UpdateObjective( string name, SlashCo.ObjStatus status, number count, boolean dontOverrideComplete )

Description

Adds the objective name to the tracked objectives if it isn't tracked yet, or updates its status/progress otherwise.
When status is SlashCo.ObjStatus.PROGRESS and the objective has a count, count (default 1) is added to its progress, capping at the total and auto-completing it once reached.
Fires SlashCo:OnObjectiveComplete when the objective newly becomes complete.
Doesn't network the change, call SlashCo.SendObjectives afterwards to update clients.

Arguments

1string name

Name of the objective, must be a key of SlashCo.Objectives.

2SlashCo.ObjStatus status

The new status for the objective.

3number count

Required when first tracking an objective that has a count. When status is PROGRESS, the amount to add to its progress.

4boolean dontOverrideComplete

If true, does nothing when the objective is already SlashCo.ObjStatus.COMPLETE.