

Once the above is combined, you will have a fully functional chair throwing RPG Launcher. Now we've defined the function to spawn and throw props, we need to define the ones that will actually be triggered when we fire. That means it can be used to throw almost anything, from barrels to ragdolls. It accepts one argument, the filename of the model to be used. This function we are defining will spawn and throw the chair. Both Reload and Think are not needed by this SWep so we will provide empty functions for them. It is always good practice to precache sounds, so there is no delay when using the gun. The next piece of information is important. Your SWep will work without most of this information, but it's ideal to include details. It is possible to to include both the server-only and client-only code in the shared.Īt the top of the shared. There is however, an alternative way of laying out SWeps. Normally this is used only for weapon information. This is for functions that will affect clients individually.

This environment will contain functions that will affect the server, such as killing players or throwing things. Now, create a new directory with a simple name without spaces for your SWep. Popular choices for SWeps include launching objects, such as watermelons or chairs, and 'better' versions of existing weapons, like a crossbow that can shoot several bolts per second. Here are whatever default categories you want.Better known as a SWep or SWEP in some cases a scripted weapon is a weapon that has an underlying script controlling its operation. Learn more about bidirectional Unicode characters To review, open the file in an editor that reveals hidden Unicode characters. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below.
