so ich habe jetzt ma den script von http://wiki.garrysmod.com/wiki/?title=Lua:VGUI_Basics
kopiert
Lua Code:
function TestVGUI( )
local Frame = vgui.Create( "Frame" ); //Create a frame
Frame:SetSize( 200, 200 ); //Set the size to 200x200
Frame:SetPos( 100, 100 ); //Move the frame to 100,100
Frame:SetVisible( true ); //Visible
Frame:MakePopup( ); //Make the frame
Frame:PostMessage( "SetTitle", "text", "This is the title" ); //Set the title to "This is the title"
local Button = vgui.Create( "Button", Frame ); //Create a button that is attached to Frame
Button:SetText( "Click me!" ); //Set the button's text to "Click me!"
Button:SetPos( 30, 5 ); //Set the button's position relative to it's parent(Frame)
Button:SetWide( 100 ); //Sets the width of the button you're making
function Button:DoClick( ) //This is called when the button is clicked
self:SetText( "Clicked" ); //Set the text to "Clicked"
end
end
concommand.Add( "testvgui", TestVGUI );
aber ingame passiert genau das gleiche wie bei meinem wen ich den command testvgui eingebe ->
Code:
vguitest.lua:3: attempt to index global 'vgui' (a nil value)