1. Post #1

    July 2009
    9 Posts
    i just started to script my own gamemode and i really want to add a swep to it and be able to equip it to a team. so how do i get my swep working? also i need to know how to install a swep into my gamemode.

  2. Post #2
    Gold Member
    Gbps's Avatar
    December 2008
    3,647 Posts
    (If you have that kind of grammar, you shouldn't take up LUA coding at all)

    But if you insist,

    I would start out by download a swep from http://www.garrysmod.org and adding it to your addons folder.

    Then edit your GM:PlayerLoadout function to include a line that says:
    ply:Give('[swepname]')
    

  3. Post #3
    Dennab
    May 2009
    767 Posts
    I think it's
    ply:Give( "SWEP name" )

    I don't know whether it matters whether it's ' or ".

    To actually add sweps, get the LUA file and put them in "gamemode name"/entities/weapons.

    You may need to make the weapon folder.

    Edited:

    I think it's [ LUA]ply:Give( "SWEP name" )[/LUA]

    I don't know whether it matters whether it's ' or ".

    To actually add sweps, get the LUA file and put them in "gamemode name"/entities/weapons.

    You may need to make the weapon folder.