• Giving a table?
    3 replies, posted
Hey, is there any way that I can give myself a table of weapons using ply:Give() ? very sorry for the noob question, but this would help me out a lot!
From my debug code: This will give you all weapons that are "installed" in the server. [lua]concommand.Add( "giveall", function( ply, cmd, args ) if ( !IsValid( ply ) ) then return; end -- if ( IsValid( ply ) && !ply:IsSuperAdmin( ) ) then Log( ply, "tried to giveall." ); return; end for k, v in pairs( weapons.GetList( ) ) do ply:Give( v.ClassName ) print( "Giving " .. v.ClassName .. " .. " ) end end)[/lua]
[code]local table = {"weapon_pistol", "weapon_crowbar"} for id, wep in pairs( table ) do ply:Give(wep) end[/code]
Thank you so much guys, ill try this out. [editline]28th June 2013[/editline] Worked! helped me finish my gun saving system, thank you so much!
Sorry, you need to Log In to post a reply to this thread.