Support (Read Only) > Help

FML Panel!!!

(1/2) > >>

mdew355:
Hey, I'm making a gamemode and I'm trying to get a derma panel but everytime I run it I get and LUA Error saying that it can't call a global nil value, something like that. Below is mai code and the error XD Thank you for any help given.


--- Code: ---function set_team()
    local frame = vgui.Create( "DFrame" )
    frame:SetPos( ScrW() / 2, ScrH() / 2 )
    frame:SetSize( 200, 210 )
    frame:SetTitle( "Get Team!" )
    frame:SetVisible( true )
    frame:SetDraggable( false )
    frame:ShowCloseButton( false )
    frame:MakePopup()
     
    team_1 = vgui.Create( "DButton", frame )
    team_1:SetPos( frame:GetTall() / 2, 5 )
    team_1:SetSize( 80, 100 )
    team_1:SetText( "Join a team!" )
    team_1.DoClick = function()
        RunConsoleCommand( "team1" )
    end   
end
concommand.Add("team_menu", set_team)
--- End code ---

And now the Error.


--- Code: ---[gamemodes\dodgeball\gamemode\init.lua:60] attempt to index global 'vgui' (a nil value)

--- End code ---

SMasters:
I'm not good at lua or anything but post the whole code maybe, and which is line 60? Maybe that will help to fix this error.

Tomcat:

--- Quote from: Majora's Mask on September 17, 2010, 09:41:43 PM ---I'm not good at lua or anything but post the whole code maybe, and which is line 60? Maybe that will help to fix this error.

--- End quote ---


yes please tell me witch line in this snipp


NVM:


You need to run derma and vgui clientside

mdew355:
Line 60 is : local frame = vgui.Create( "DFrame" )

And I have it under cl_spawnmenu.lua

Tomcat:
I still dont think its running clientside

Navigation

[0] Message Index

[#] Next page

Go to full version