Author Topic: FML Panel!!!  (Read 188 times)

0 Members and 1 Guest are viewing this topic.

Offline mdew355

  • **
  • Posts: 76
  • Respect: +14
FML Panel!!!
« on: September 17, 2010, 08:19:28 PM »
0
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: [Select]
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)

And now the Error.

Code: [Select]
[gamemodes\dodgeball\gamemode\init.lua:60] attempt to index global 'vgui' (a nil value)
Max: i picked it up
Max: SAID OMG
Max: THIS IS A TONKA TOY
Max: then i played with
Max: it
Max: Loved IT
mdew: that's what she said
mdew: :O

Offline SMasters

  • That's a paddlin
  • ***
  • 2009 Snowball Competition Winner
    View More Badges!

  • Posts: 208
  • *jeopardy music*
  • Respect: +102
Re: FML Panel!!!
« Reply #1 on: September 17, 2010, 09:41:43 PM »
0
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.

Offline Tomcat

  • Your Argument is Inert
  • ******
  • Donator
    View More Badges!

  • Posts: 2539
  • Gender: Male
  • Wat Do?
  • Respect: +503
    • Tomcat's blog
Re: FML Panel!!!
« Reply #2 on: September 17, 2010, 10:24:23 PM »
0
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.


yes please tell me witch line in this snipp


NVM:


You need to run derma and vgui clientside

Offline mdew355

  • **
  • Posts: 76
  • Respect: +14
Re: FML Panel!!!
« Reply #3 on: September 19, 2010, 11:42:04 PM »
0
Line 60 is : local frame = vgui.Create( "DFrame" )

And I have it under cl_spawnmenu.lua
Max: i picked it up
Max: SAID OMG
Max: THIS IS A TONKA TOY
Max: then i played with
Max: it
Max: Loved IT
mdew: that's what she said
mdew: :O

Offline Tomcat

  • Your Argument is Inert
  • ******
  • Donator
    View More Badges!

  • Posts: 2539
  • Gender: Male
  • Wat Do?
  • Respect: +503
    • Tomcat's blog
Re: FML Panel!!!
« Reply #4 on: September 20, 2010, 02:59:26 PM »
0
I still dont think its running clientside


Offline mdew355

  • **
  • Posts: 76
  • Respect: +14
Re: FML Panel!!!
« Reply #5 on: September 20, 2010, 11:12:21 PM »
0
I still dont think its running clientside

So then how would I get it to run ClientSide?
Max: i picked it up
Max: SAID OMG
Max: THIS IS A TONKA TOY
Max: then i played with
Max: it
Max: Loved IT
mdew: that's what she said
mdew: :O

Offline Tomcat

  • Your Argument is Inert
  • ******
  • Donator
    View More Badges!

  • Posts: 2539
  • Gender: Male
  • Wat Do?
  • Respect: +503
    • Tomcat's blog
Re: FML Panel!!!
« Reply #6 on: September 21, 2010, 02:06:57 PM »
0
Use

G.AddCSLuaFile   

In your main init file with that file's name in it

Offline mdew355

  • **
  • Posts: 76
  • Respect: +14
Re: FML Panel!!!
« Reply #7 on: September 22, 2010, 10:00:33 PM »
0
Use

G.AddCSLuaFile   

In your main init file with that file's name in it


Already been done for awhile. That is usually my first instinct.
Max: i picked it up
Max: SAID OMG
Max: THIS IS A TONKA TOY
Max: then i played with
Max: it
Max: Loved IT
mdew: that's what she said
mdew: :O

Offline Кrаsher

  • ****
  • Posts: 436
  • Gender: Male
  • Posts: 9001
  • Respect: +50
Re: FML Panel!!!
« Reply #8 on: September 23, 2010, 05:08:22 PM »
0
Which line is number 60?





Offline SMasters

  • That's a paddlin
  • ***
  • 2009 Snowball Competition Winner
    View More Badges!

  • Posts: 208
  • *jeopardy music*
  • Respect: +102
Re: FML Panel!!!
« Reply #9 on: September 23, 2010, 06:27:48 PM »
0
Which line is number 60?
Line 60 is : local frame = vgui.Create( "DFrame" )

And I have it under cl_spawnmenu.lua