Author Topic: The World of Lua  (Read 2281 times)

0 Members and 1 Guest are viewing this topic.

Offline Tommo1590

  • Newbie
  • *
  • Posts: 37
  • Karma: 1
The World of Lua
« on: December 28, 2010, 04:55:40 PM »
So ive decided to TRY and teach myself Lua with the help of Garrysmod Wiki...
My first little project so to speak is to make a form of MOTD with tabs and im posting here because of well i hate facepunch, its full of people with non-helpful comments but yea ive started making this motd and got a error already lol... its:

Code: [Select]
[lua\autorun\motd.lua:3] attempt to index global 'vgui' (a nil value)
and the code im using is:
Code: [Select]
function testpanel()

local DermaMOTD = vgui.Create("Frame")
DermaMOTD:SetTitle( "Welcome to blah blah blah" )
DermaMOTD:SetPos( 50,50 )
DermaMOTD:SetSize( 500, 500 )
DermaMOTD:SetVisible( true )
DermaMOTD:SetBackgroundBlur( true )
DermaMOTD:SetDraggable( true )
DermaMOTD:ShowCloseButton( true )

DermaMOTD:MakePopup()

end

concommand.Add("testmenu", testpanel)

now i dont see how this can be making a error as it is just from the garrysmod wiki but can anyone help please???

Edit:
I have changed the way the function works and it seems to have fixed it, just shows how Wiki have to much wrong information  ;D

« Last Edit: December 28, 2010, 06:32:23 PM by Tommo1590 »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: The World of Lua
« Reply #1 on: December 30, 2010, 05:13:35 PM »
Glad that we were able to, erm, help you! Just let us know if you have any other questions. :)
Experiencing God's grace one day at a time.