Seite 2 von 2 ErsteErste 12
Ergebnis 11 bis 15 von 15

Thema: erste LUA versuche

  1. #11

    Standard AW: erste LUA versuche

    so ich habe jetzt ma den script von http://wiki.garrysmod.com/wiki/?title=Lua:VGUI_Basics
    kopiert
    Lua Code:
    1. function TestVGUI( )
    2.  
    3. local Frame = vgui.Create( "Frame" ); //Create a frame
    4. Frame:SetSize( 200, 200 ); //Set the size to 200x200
    5. Frame:SetPos( 100, 100 ); //Move the frame to 100,100
    6. Frame:SetVisible( true ); //Visible
    7. Frame:MakePopup( ); //Make the frame
    8. Frame:PostMessage( "SetTitle", "text", "This is the title" ); //Set the title to "This is the title"
    9.  
    10. local Button = vgui.Create( "Button", Frame ); //Create a button that is attached to Frame
    11. Button:SetText( "Click me!" ); //Set the button's text to "Click me!"
    12. Button:SetPos( 30, 5 ); //Set the button's position relative to it's parent(Frame)
    13. Button:SetWide( 100 ); //Sets the width of the button you're making
    14. function Button:DoClick( ) //This is called when the button is clicked
    15. self:SetText( "Clicked" ); //Set the text to "Clicked"
    16. end
    17.  
    18. end
    19.  
    20. 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)

  2. #12

    Standard AW: erste LUA versuche

    Es ist DFrame und nicht Frame und DButton und nicht Button!

  3. #13
    Avatar von Alex22
    Registriert seit
    11.11.2005
    Ort
    Berlin

    Standard AW: erste LUA versuche

    Zitat Zitat von Pac_187 Beitrag anzeigen
    Es ist DFrame und nicht Frame und DButton und nicht Button!
    Sieht eher so aus, als hätte er das Script nicht in den Client Ordner gepackt.

    Du musst deine Lua Files in den Ordner:
    XX\lua\autorun\client
    schieben.

    Und ich glaube eine init.lua und eine cl_init.lua reinpacken. In init.lua muss:
    Lua Code:
    1. AddCSLuaFile( "DATEINAME.lua" )
    und in der cl_init.lua:
    Lua Code:
    1. include( 'DATEINAME.lua' )
    stehen.

    Nicht meckern wenn das nicht stimmt, nur ich hatte das selbe Problem und es wurde damit gelöst.



  4. #14

    Standard AW: erste LUA versuche

    Zitat Zitat von [FX]CJ[CSR] Beitrag anzeigen
    so ich habe jetzt ma den script von http://wiki.garrysmod.com/wiki/?title=Lua:VGUI_Basics
    kopiert
    Lua Code:
    1. function TestVGUI( )
    2.  
    3. local Frame = vgui.Create( "Frame" ); //Create a frame
    4. Frame:SetSize( 200, 200 ); //Set the size to 200x200
    5. Frame:SetPos( 100, 100 ); //Move the frame to 100,100
    6. Frame:SetVisible( true ); //Visible
    7. Frame:MakePopup( ); //Make the frame
    8. Frame:PostMessage( "SetTitle", "text", "This is the title" ); //Set the title to "This is the title"
    9.  
    10. local Button = vgui.Create( "Button", Frame ); //Create a button that is attached to Frame
    11. Button:SetText( "Click me!" ); //Set the button's text to "Click me!"
    12. Button:SetPos( 30, 5 ); //Set the button's position relative to it's parent(Frame)
    13. Button:SetWide( 100 ); //Sets the width of the button you're making
    14. function Button:DoClick( ) //This is called when the button is clicked
    15. self:SetText( "Clicked" ); //Set the text to "Clicked"
    16. end
    17.  
    18. end
    19.  
    20. 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)
    Ich hab jetzt auch noch mal ne ganz dumme Vorahnung, dass du das alles aufen Server ausführst, da gibs das vgui Library ja auch nicht.

  5. #15

    Standard AW: erste LUA versuche

    ich führ die scripts im singleplayer aus
    wo den sonst?
    der script liegt in lua/autorun/client (wie im video tutorial)

    EDIT: so ich habe den bug behoben warum es nicht ging ..
    danke benny das du gesagt was fehlt (vgui "library")

    ich hab jetzt das genommen
    [ame]http://garrysmod.org/downloads/?a=view&id=21577[/ame]
    geht auch
    Geändert von gamerpaddy (20.04.2009 um 01:12 Uhr)

Ähnliche Themen

  1. GMod Tower
    Von Maurice im Forum Lua
    Antworten: 336
    Letzter Beitrag: 01.12.2009, 12:57
  2. Massenweise Lua Fehler biem starten von Gmod
    Von Ponzius im Forum Hilfe & Support
    Antworten: 4
    Letzter Beitrag: 16.03.2008, 20:22
  3. Splatter Mod geht NICHT und kein Blut in gmod!
    Von PytonB!tch im Forum Addons
    Antworten: 12
    Letzter Beitrag: 16.08.2007, 12:25
  4. sweps kommen net
    Von Dark im Forum Lua
    Antworten: 13
    Letzter Beitrag: 27.07.2006, 22:11
  5. Kleine Hilfe: Wie lerne ich Lua?
    Von Scarecrow im Forum Lua
    Antworten: 0
    Letzter Beitrag: 04.02.2006, 19:10

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •