How to check the Players class in fretta

Im new to lua and i want to make it where if a person has x kills and lets say he’s an Assault class he gets an m4. I know how to track kills but not how to check the players class any help??

sorry but most of those pages aren’t even started…

Wooow, read the page. Use Team.GetClass()

Team.GetClass() retrieves the table of all classes for that team.
He just wants the class of the player.

Player.GetPlayerClass() is what he’s looking for, but it’s undocumented, so it’s difficult to know what it returns without some trial.

i wish someone would go through and filll the wiki up it’s not much help like it is now. Anyway so using Player.GetPlayerClass() would i then put functions for it to run? I guess ill have to test it a bit more.
EDIT: How would i use the value, lets say the players class is a sniper. What code would represent that for if statements?

If the variable for the name of the class is, for example, “Sniper”
I assume you’d use:

if pl:GetPlayerClass() == “Sniper” then
code
end

Obviously replacing pl with whatever player variable you’re using.
Note that I’m not sure… I’ve literally been coding Lua in GMod for two or three days now, so I’m just going on what I know. But I’m looking at the function in player_extension.lua in the fretta base, and I think that should work. If not, try to print pl:GetPlayerClass() to the console and see what you get.