Skip to content

achievements

add

Type

function

Description

Adds a new achievement to the FC2 achievement module. If an achievement already exists, this function will return an error and nil.

Parameters

  • string name
  • string description

Returns

  • achievement

get

Type

function

Parameters

  • string name

Returns

  • achievement

list

Type

function

Description

This will list all achievements currently in the FC2 module. This includes custom added achievements via achievements:add.

Returns

  • table achievement

is_unlocked

Type

function

Parameters

  • string name

Description

This function will check if an achievement is unlocked. If so, it will return the timestamp of when the achievement was unlocked. Otherwise, false.

Returns

  • number|boolean

unlock

Type

function

Parameters

  • string name

Description

This function will unlock an achievement. This will not allow you to unlock hard-coded achievements. This function only works on achievements added via achievements:add.


revoke

Type

function

Parameters

  • string name

Description

This will revoke an unlocked achievement, allowing you to unlock it again. This is good for testing or resetting your achievements.dat without deleting the file itself.