Traits

A character customization system with the use of perks.

Functions

impulse.HasTrait(trait)

View source »

Test for local player traits.

Parameters

  • trait number

    The trait ID to test for.

Returns

  • bool

    Does the local client have this trait.

impulse.Traits.Define(displayName, description, traitPointCost, forcedKey)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

View source »

Define a new trait.

Parameters

  • displayName string

    The name displayed on the client.

  • description string

    The description of the trait, displays on the client.

  • traitPointCost number

    The amount of points it costs to get this trait, can be negative to increase the limit of traits.

  • forcedKey number optional

    Forced DB storage key to prevent scrambling of order.

Player:AddTrait(trait, saveToDb)

View source »

Adds a trait to a player, saves to database unless specified otherwise.

Parameters

  • trait number

    The ID of the trait to add.

  • saveToDb boolean default: true

    If true, it saves all trait data to the database.

Player:HasTrait(trait)

View source »

Determines if a player has a trait.

Parameters

  • trait number

    The ID of the trait to test for.

Returns

  • bool

    Has specified trait.

Player:TakeTrait(trait, saveToDb)

View source »

Takes a trait to a player, saves to database unless specified otherwise, throws an error if the player doesn't have the trait.

Parameters

  • trait number

    The ID of the trait to take.

  • saveToDb boolean default: true

    If true, it saves all trait data to the database.

Tables

DefaultTraits

View source »

The default traits.

Fields

  • TRAIT_TEST

    A test trait.

  • TRAIT_SOCIOPATH

    Increases melee damage and melee speed.

  • TRAIT_ATTENTIVE

    Increases hearing range and noise source accuracy.

  • TRAIT_UNREMARKABLE

    Cameras have a chance to not detect you. Even with a rebel suit or BOL.

  • TRAIT_TOUGHSKIN

    Chance to not bleed when you normally would.

  • TRAIT_BLOODRUSH

    As health decreases, speed and accuracy increases. (Up to 33% buff)

  • TRAIT_QUICK

    Anything that takes time to do is x2 faster.

  • TRAIT_LUCKY

    Today could be your lucky day!