Creating a TTT Scoreboard

Hello everyone,
I want to create my first (ttt) scoreboard and I’m looking for some advices.
I don’t really know how to do this the best way.
I looked for the default TTT Scoreboard and they are using vgui.Register. I haven’t used this function yet and the wiki can’t really help me out. Can somebody explain?
Also, they are using hook.Call with “TTTScoreGroups” or “TTTScoreGroup” and I can’t find any documentation about this.
They are using this to create the ScoreGroups:
vgui.Create(“TTTScoreGroup”, self.ply_frame:GetCanvas())
However I don’t know this VGUI Element; so how to use it?
Any help is appreciated.
Regards, Pascal

Take a look to it in gamemodes/terrortown/gamemode/vgui/TTTScoreGroup.lua
I think

[editline]27th October 2015[/editline]


Like I said, I already looked into the default scoreboard, but I couldn’t understand some things.


I want to learn more, but I need some information. That’s why I’m asking ^^

Don’t discourage he came here trying to learn more. No need to try and put him down.

Ask what are those things you dont understand

The vgui register is to create a new vgui element, as a dbutton or a dpanel.
They are just normal panels with some modifications

[editline]28th October 2015[/editline]

Now hooks.
Do you see when you create a hook for the chat and return an empty string to hide the chat message? When you return that, the hook call functions return what youve returned. Also, the arguments of that function is just the callback arguments of the hook

Everyone started somewhere and at least he’s not being one of those rude “code it for me” people. He’s also a customer of mine and actually tries to understand and learn Lua, so beating someone down and telling them “you aren’t advanced enough” is not exactly words of encouragement.

I think I understand: You can make a table with your panel data and register it afterwards with vgui.Register(“name”, tablename)
Afterwards you can create the panel with vgui.Create(“name”) right?

I will try this out, thanks! :slight_smile:
If I need any further assistance, I will ask.