Garry's Mod Wiki

achievement_earned

Description

Called when a player earns an achievement.

Members

number achievement
The achievement ID.
number player
The UserID of the player.

Examples

Example

This is a basic template with the purpose of including all arguments / table variables to make it easily known which values can be accessed.

gameevent.Listen( "achievement_earned" ) hook.Add( "achievement_earned", "achievement_earned_example", function( data ) local achievement = data.achievement -- The achievement ID local player = data.player -- Same as Player:UserID() -- Called when a player earns an achievement. end )