Hai. Todae I r teech u hao to duu dis. N nao i stawp w/ 1337 spek.
// Achievement by Teh_Spy
// Version 1.1
// Achievement: Equip your para.
These lines have nothing to do with the achievement, they are just there to mark that you made it or to keep track of the version history.
In fact, you can delete them and nothing will happen. Usually, if something has an “//” in front of it then you can delete the line without worry. Even though, you probably wouldn’t ever need to. They are put there to leave notes for later releases and/or modifications.
local Value = achievements.GetValue( “Para… MEDIC!”, “total”, 0 ) [/lua] This line should only be edited to change the name. The name is this part. “Para… MEDIC!”. You want to change that to the name of your achievement. Example: “My First Achievement”
local Status = false
local function Update()
if (Value != 1) then // print("Check Started.
local ply = LocalPlayer()
local weap = ply:GetActiveWeapon()
if (!ValidEntity( ply )) then return end if ( ValidEntity( weap ) && weap:GetClass() == "weapon_para" ) then
This line checks to see if the player’s weapon is the para from CS:S.
The only thing you should be worried about is the “weapon_” part. You want to change that to whatever weapon you want. You will need a valid ID for it, though. I suggest using google for looking for HL2 “Cheats” and it will say under “Give” commands–The valid ID for the weapon. EX: Weapon_RPG, Weapon_Frag.
if !Status then
Status = true
// print("Para Started.
Value = math.Clamp( Value + 1, 0, 1 )
achievements.SetValue( “Para… MEDIC!”, “total”, Value )
achievements.Update( “Para… MEDIC!”, Value / 1, Value … “/1” )
Status = false
// print("Para Ended.
These lines ensure that the player has no longer equipped the para. Along with the mathematics for how many times. If you wanted to change the amount of times you want to switch to your para, change the section “math.Clamp( Value +1, 0, X )” and "Value / 1, Value … “/1” ). Obviously, replacing the X’s with the number you want.
If you change the “( Value +1,” to another number, such as 2, your achievement will automatically calculate as +2 every time the player does the specific task.
// print("Check Ended.
else timer.Destroy("Achievement.paramedic") end
This part makes the add-on read that you have no longer have your para equipped. Very simple, right?
timer.Create(“Achievement.paramedic”, 1, 0, Update)
This line, should be the name of the file. Replace “Achievement.paramedic” with whatever you are going to save your achievement .lua as.
If I remember correctly, you probably want to change the number 1 to whatever you want on the section:
“, 1, 0, Update”
achievements.Register( “Para… MEDIC!”, “Equip an M249 Para.”, “achievements/paramedic”, Value / 1, Value … “/1” )
This is what I call the “Defining” section. I am going to break it up into easier portions for you all.
( “Para… MEDIC!”
This is the name of your achievement.
“Equip an M249 Para.”
This is not important, infact you can leave it blank. This is the “Description” line that will appear under your achievement’s name in-game.
This is the icon of your achievement in achievements\materials\achievements
You will need to rename “paramedic” with whatever your .vmt file is named and your VMT has to be set to the image icon.
Value / 1, Value … “/1” )[/lua]
This is the progress bar. You want to change these numbers to match up with the values you’ve changed earlier.
OKAY. That’s it. You’re done.
My steam name is Teh_Spy.
I changed it along time ago.
If you want to download this achievement that I am using as an example (give me credit if you put it in your add-on or gamemode):
You can use the achievement example above as a template if you choose.