Scripted Weapons (SWEPs) in your map

From GMod Wiki

Jump to: navigation, search
Entity1.PNG Go to:
Mapping Entities
Mapping: SWEPs Placing
Page white text.png Description:How to place Scripted Weapons
link=User:Cuel Original Author:Cuel
Calendar.png Created:25th April 2007

Introduction

In this tutorial you will be shown how to place Scripted Weapons from Garry's-mod into your map.


Placing Counter-Strike: Source SWEPs

We will start with CS: S SWEPs, since they seem to work in most gamemodes.

  1. Place any entity in hammer (not brushed based ones), where you want your weapon.
  2. Select your entity and bring up properties (Alt + Enter)
  3. In the Class field (name of the entity) type the name of your weapon (See list).


These are the current CS: S SWEPs

weapon_ak47
weapon_deagle
weapon_fiveseven
weapon_glock
weapon_m4
weapon_mac10
weapon_mp5
weapon_para
weapon_pumpshotgun
weapon_tmp

Hit Apply and run your map.

Other SWEPs

This method might not always work, and you mostly need your gamemode loaded for the SWEPs to work. If, they are in a gamemode of course.

Note: GMDM weapons will NOT work with this method. Check the example map to see how to place GMDM weapons.

The reason that this method might not always work is because sometimes the SWEPs might not have a world model, or they have another entity name then you type or some other error.

For this example, I will use LightRP version 1 gamemode.

  1. First, we will set LightRP gamemode as default.
  2. After you've set gamemode to LightRP, place any entity (not a brushed-based one), where you want your weapon.
  3. Go to <steamdir>garrysmod\garrysmod\gamemodes\LightRP\entities\weapons where we will find the SWEPs. As you can see, the folders are named;
    arrest_stick, door_ram, keys, stools and stunstick.
    I've tested arrest_stick and door_ram, they both worked. the keys did however not.

The name of the folders are the names we will type in hammer.

  1. Select the entity and bring up properties (Alt + Enter ).
  2. In the Class field (name of the entity) type your weapon name. (See Image)
  3. Compile and run your map!
What it should look like.


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox