Garry's Mod Achievements

Ok so hi guys. I recently visited a server that really had some cool lua scripting. I even asked the guy for help me do achievements like his. He told me that he is using the orginal achievement based Example, but I’m having trouble fiiguring it out. He gave me a link and this is what is in the example box :

local achievmentsID, count, goal, achieved, desc, name = achievements.Count()
for achievmentsID = 1, achievmentsID do
count = achievements.GetCount(achievmentsID)
goal = achievements.GetGoal(achievmentsID)
achieved = achievements.IsAchieved(achievmentsID)
desc = achievements.GetDesc(achievmentsID)
name = achievements.GetName(achievmentsID)
print(count, goal, achieved, description, name)
end

Ok now I can REALLY use some help here and i would seriously appreciate if somebody will give me a hand! Thank you

Eh. That code, when run, will give you a list of properties of all achievements.

I really don’t know what’s the problem. (Also use [noparse][lua] CODE HERE [/lua][/noparse]-tags!)

It’s not a certain problem. I just need somebody to EXPLAIN the code to me because I don’t understand it :S

Edit : What i mean is how to make an achievement based like the real one? I have a ZS server that i would really like for it to have achievements

Look at the achievements that come with it?

You see the last line?
It’s asking for a variable called “description” but everywhere else you call it “desc”.

Look a friend just suggested that I try to do achievements BASED the originals Garry Newman made. He gave me this site but I don’t understand how to make an achievement based on this code.

I’m pretty sure you can’t add achievements to Garry’s achievement thingy. There are a bunch of LUA achievement frameworks out there, go search.

You can, but they won’t show up for anyone else than you.

The menu is made in lua; you can add to the menu yourself although since it’s in the menu environment, you can’t add to it via files sent from the server, and the achievement will only be for you.

Yeah ok ok. Going to change subject. Since i can’t find what I’m looking for with this way, I’m going another way. So I tried making some Rabbit Toaster-like Achievements. So far I know how to make some stuff, but not the more complicated like. For an example how to achieve something like hitting a player with a headshot

So for this achievement that i want to make I am not sure how to choose to recognize if the Player is hit in the head. I heard something about HITBOX or HITGROUP, but I’m not sure how to combine the victim and the Hitbox or hitgroup thing. I tried …&& victim_hitgroup == hitgroup_head but it didn’t work. If anybody can explain and give me some other commands that are useful for killing in different possitions and stuff I would really appreciate it