Getting kills and Score Font

Yup, some other questions <.>

Is there a way to get a player’s kills to make something happen? Like, if I kill 40 people, I get new weapons.
I also had some problems killing NPCs in my gamemode, when I kill an NPC, it doesn’t give me any kills.
One last thing, how to change the scoreboard font :v: ?


Returns the number of kills a player has accumulated. Combine:

To give you NPC kills. To change your scoreboard font, take a look at the cl_scoreboard.lua (or whatever garry calls it) in the base gamemode.

Ok, useful stuff. I’m checking this out, I’ll return in a second to tell you if it works.
The kill ‘n’ get weapons stuff doesn’t work.

Post the code.

The code is the same on the Wiki, I wanted to test it.

The error is just a black screen.

About the Scoreboard, what is the IN_ key? I mean, is it [lua]“IN_SHOWSCOREBOARD”[/lua]?

There is no IN_ key for that. Maybe if you went to the wiki instead of relying on us to answer everything you would already know. Now go to the wiki and search scoreboard, I dare to do it and not find what you’re looking for!

God, I really didn’t mind searching for “scoreboard”, I killed myself searching the IN_ key…
Anyway, now I have another question:
[lua]function GM:ScoreboardShow()
Automatically replaces the use of the Scoreboard or just adds a command?

Anything you place in there will happen when the scoreboard keybind is pressed, not much else. To disable the current scoreboard return true at the end.

And for IN_ keys and other enumerations next time on the wiki you can go to Lua > Useful Information > List of enumeration

Most commands that use IN_ keys will also have a link to the list or the list itself.

Now, if I can ask something else, I’d like to remove the key “F2” so to make people not able to change team.


I have tried it already
function DeleteKey()
hook.Add(“ShowTeam”, “Delete”, DeleteKey)
Does not work.

Of course, because you’re returning nothing at all. :smiley:
Nothing (or in lua nil) is not the fame as false. Try returning either true or false. Also note that the semi-colon you stuck in there does nothing at all.

I tried that too… I’ll try again.
It works… but I needed to remove the use of the Key… now the TeamMenu doesn’t open at the first spawn :confused:
I tried making the player join the ‘Blue’ team at the Initial spawn but it doesn’t work…

Is there another way to get a player’s kills and build a function on it?
I mean other than “best score”.