Script errors by pressing tab



[ERROR] gamemodes/terrortown/gamemode/vgui/sb_team.lua:81: attempt to perform arithmetic on field 'Width' (a nil value)
  1. unknown - gamemodes/terrortown/gamemode/vgui/sb_team.lua:81


Each time anyone on the server presses tab several of these errors pop up in console. This is the lua file, im not entirely sure how to fix it. Any help would be awesome, Thanks.

is this the default ttt scoreboard?

I use colored ranks so its a different row and main file.
Main - http://pastebin.com/ciFNcHyh
Row - http://pastebin.com/XxDqBW9q
Edit, I reverted back to the default scoreboard files and the issues is still there. So im assuming it has to do with the first lua I linked on the first post

Bump, encountering this same issue, same situation as OP

Have you both updated TTT to the newest version?

TTT is updated with Gmod updates, correct? If so then yes.

On the actual server I don’t think so. I’m pretty sure if you edited a core file it also wouldn’t be updated. Can someone else confirm?

Someone else had this issue and the fix was to update, or to ensure they were updated.

I believe that TTT does update when Gmod updates even on the server, because when the server updates it overwrites my sb_main and sb_row files in the TTT folder.

[lua]for k,v in ipairs(sboard_panel.cols) do
cx = cx - v.Width[/lua]

Width is not set in sboard_panel.cols for the elements. Do you know where it’s defined?

No.

Bump.

CTRL+F it. If you can’t find it then define it yourself.


local Width = 1 --whatever the value is

This is still not fixed, and I’ve tried defining width. I need help.

You could use [lua]( v.Width || 50 )[/lua] in place of [lua]v.Width[/lua] which should be the default column width in the latest update for the TTT Scoreboard.

I’m also having the same issue. Replacing v.Width with ( v.Width || 50 ) did not help.

This is my sb_team.lua file that i replaced and it fixes the error. So I guess just replace your current sb_team.lua file with this code and it should work fine