• Scripting A derma Menu Help.
    4 replies, posted
Ok, so I need to create a menu for my gamemode. It is to select one weapon so i have this already: ~~~WeaponGive.lua~~~ function GivePlayerAWeapon( ply, cmd, args ) if args[1] == "gun" then ply:Give("weapon_smg") end concommand.Add("weapon_take", GivePlayerAWeapon) ~~~WeaponLoadout.lua~~~ function WeaponLoadoutMenu () local TestingComboBox = vgui.Create ( "DComboBox" , DermaFrame ) TestingComboBox:SetPos( 10, 35 ) TestingComboBox:SetSize( 100, 185 ) TestingComboBox:SetMultiple( false ) TestingComboBox:AddItem( "gun" ) --So? after this to select the weapon do i do: TestingComboBox.DoClick = function() RunConsoleCommand( "weapon_take" , "gun" ) or something else? Any help is appreciated in advanced, thank you.
use lua tags [lu a] and [/lua]
can you send me to a tutorial on what, and how to use those. pl0x =3
For starters I think you should read the Lua Tutorial Series and [url]http://lua.org/pil/[/url] [b][url=http://wiki.garrysmod.com/?title=Lua_Tutorial_Series]Lua Tutorial Series [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] What C-Unit meant was to use lua tags to read code. put [lu[b][/b]a] and [/lu[b][/b]a] around you're code. You're first if statement dosent have a ending. Make sure in you're server file you are using [b][url=http://wiki.garrysmod.com/?title=G.AddCSLuaFile]G.AddCSLuaFile [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] I would suggest you read up on the wiki then see if you can understand more of you're errors if you are interested in becoming fluent in Lua. If not then you should post a request in the request section.
Well, have you tried it?
Sorry, you need to Log In to post a reply to this thread.