SlashCo Wiki

SlashCo.CanEquipPerk

 boolean, string, table SlashCo.CanEquipPerk( Player ply, string checkPerkID )

Description

Checks whether a player is allowed to equip a perk.
The perk must exist, the player must meet its level requirement, and the player must own it.
The perk must also not conflict with any currently active perk.
Returns a failure reason and, for conflicts, the conflicting perk definition.

Arguments

1Player ply

Player attempting to equip the perk

2string checkPerkID

ID of the perk to check

Returns

1boolean canEquip

Whether the player can equip the perk

2string reason

Failure reason, such as perk_invalid, perk_level_too_low, perk_not_owned, or perk_conflict

3table conflictingPerk

The conflicting active perk when the failure reason is perk_conflict, otherwise nil