Scoreboard updating

Hi all,

I am making a scoreboard and have got the layout and panels all done, but there is one thing I don’t know how to do. I need to insert all the players into the DIconLayout I have ( I know how to do this ) but then it doesn’t update.

So how should I go about making the scoreboard update and show players information in realtime.


Timer any labels, avatars, etc that need to be updated.

I’d recommend either making some “update” function for each element, or for the entire panel. It should essentially do everything that is done when the panel is created / elements are added aside from the actual creation bits. Meaning, separate the bits that create the element from what fills in the data, then you’ll have a function which will update the elements.

Then, you can either create a timer when the panel is opened and destroy it when it is closed, or some other method to update information like that. Doing things this way can be messy.

A better alternative is when a point is scored, depending on how point is scored ( if it is a death, there are clientside game-events for that ) you can update it in real-time if you set it up to do so.

Example… Some elements grab the data and store it internally… You can actually have it call a player meta-table function to get that data ( this is where caching is important so don’t use NW vars unless you cache them, use something like :Frags( ) etc that is stored on the client and doesn’t requery the server and which only gets updated by the server when it needs updating ) whether it be kill count, deaths, etc…

When you add the row, save the player object and call the object meta-table functions to get the data. They are typically called in PerformLayout ( because cell sizes may change if the contents change ), or customized Skin / Paint functions.