Last week, DrTight's Automapvote script was working fine and dandy in my server on an older version of ULX. I recently decided to update to the SVN version, so the automapvote script similarly decided to not work anymore. It's giving the following error:
Warning: vgui.Create failed to create the VGUI component (DFrame)
ulx/modules/cl/cl_automapvote.lua:37: attempt to index local 'main' (a nil value)
This is the piece of code in question:
local function PaintClockFrame()
local main = vgui.Create( "DFrame" )
main:SetSize(250,60)
main:SetPos(ScrW() /2 - (main:GetWide() /2),ScrH() - main:GetTall())
main:ShowCloseButton(false)
main:SetDraggable(false)
main:SetTitle("")
main:ShowCloseButton(false)
function main:Paint()
local str = timeToStr(timeleft)
local nxtmp = "Next Map: "..nextmap
local votestr = "Changing in: "..str
if !votedone then
nxtmp = "Current Map: "..nextmap
votestr = "Next Vote: "..str
end
local h,w = main:GetWide(), main:GetTall()
surface.SetDrawColor( 255, 255, 255, 120 )
surface.DrawRect( 1, 1,h-1 ,w-1)
surface.SetDrawColor( 100, 100, 255, 240 )
surface.DrawOutlinedRect( 0,0,h,w )
draw.SimpleText(votestr,"ScoreboardText",10,5,Color(100,0,0,200))
draw.SimpleText("Votes Left: "..votesleft,"ScoreboardText",10,20,Color(0,0,0,200))
draw.SimpleText(nxtmp,"ScoreboardText",10,35,Color(0,0,0,200))
end
return main
end
Now seeing as the script itself was unchanged, it's also entirely possible that I simply put the files in the wrong folders after updating ULX. They're in the following locations:
garrysmod/addons/ulx/lua/ulx/modules/sv_automapvote.lua
garrysmod/addons/ulx/lua/ulx/modules/cl/cl_automapvote.lua
Anyone have any ideas?