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 IDlocal player = data.player -- Same as Player:UserID()-- Called when a player earns an achievement.end )