Garry's Mod

Garry's Mod

66 ratings
Simple Customizable Sniper
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Weapon
Addon Tags: Fun, Roleplay
File Size
Posted
1.913 KB
3 Jan, 2019 @ 8:25pm
1 Change Note ( view )

Subscribe to download
Simple Customizable Sniper

In 1 collection by Constable Reginald
Simple Customizable Weapons
8 items
Description
An extremely customizable gun (using CSS' AWP) with console variables and sliders for fun, gameplay, experimentation, and learning for those new to lua scripting! (I still am, as there are far more options I want to get working, see below)

What this does:
  • Select the damage each bullet transmits. Pew pew! ("sniper_dmg")

  • Select the spread, given by the Vector (x/100, x/100, 0). Never miss, or fire like a potato. ("sniper_spread")

  • Choose the FOV to zoom to with a right-click. ("sniper_fov")

  • Select how fast the gun fires with rounds per minute (RPM). If set to 0, fire as quickly as you can click. As the formula for this is 60/RPM, I suggest either 0, or 60 (one shot per second) or significantly higher. I believe at most you can fire is 30 shots per second, which is why the slider is capped at 1800RPM ("sniper_rpm")

  • Choose the amount of force the bullet does when it kills a target, this unit is expressed in kg * inches per second ("sniper_force") Valve uses realistic grains and speeds to calculate how much force, but then add an exaggeration multiplier of 3.5 so that even pistols make ragdolls jerk around, so see what you like. This will require a restart as this creates its own ammo.

  • Adds the CS font for accurate kill icon, as well as the ability to completely customize the color of the kill icon. Or, for a surprise, set the variables ("sniper_killicon*") to -1 to randomize the kill icon color per session (yes, the ability to randomize none, one, or all four parameters of the color structure).

  • Right-click introduces "bullet time" (not really, you're moving slower too) so you can get those satisfying headshots and see just how far your overly powered bullet sends the target flying. Right-click again (if you've set it low, you may have to hold it) to restore time back to normal ("sniper_bullettime").

What this DOESN'T do:
  • Adhere to realistic bullet inventory. The clip would not accurately count, even when trying to "feed" the swep vanilla bullets while firing my custom bullets, the clip would stay "0" while the full count of ammo went down with each shot. It was weird, and I'm too dumb or too lazy to figure it out currently. I'm still hoping I can fix it to bring some more realism for those that want it.

  • "View punch" and recoil. I don't like the idea of coming up with some arbitrary formulas that might succeed in acheiving those, but is still "made up" and is based on rules that I ultimately have to decide on. View punch isn't valid on NPCs, which is where I'd eventually like to steer this anyhow.

  • Due to limitations within the SWEP structure itself, you can not change the force multiplier employed by the swep to extremely high numbers. Therefore, this weapon creates its own ammo within the game to fix that, but as a result, you're required to restart your session if you're changing the bullet force.

  • Have spawn icons. Apparently it's as easy as just throwing .png in vgui/entities, but I wanted this addon as light as possible. If it required anything outside of what I could type, I wasn't about to do it.

  • Have weapon select icons. I thought this could be done with finding the proper font like I did with the kill icon. I either couldn't figure it out and gave up, or forgot to fully try and research to see if I could figure it out on my own.

  • Coding for NPCs. I wish I knew, it's the one thing I've wanted to do since discovering I could make my own SWEPs, and extracting others that have has gotten me nowhere near closer to figuring it out. Maybe one day. Or someone smarter than me can build upon this and make it better.

The rest:

Pistol (Damage, Force, Spread, RPM, BulletTime)


Automatics (Damage, Force, Spread, RPM, BulletTime)


Close-Range (Damage, Pellets, Force, Spread, RPM, BulletTime)


Long-Range (Damage, Force, Zoom FOV, Spread, RPM, BulletTime)

11 Comments
Elcrest, The Divine Hero 8 Apr, 2023 @ 4:56pm 
I can't seem to get the bullet time to go off. when i right click it zooms instead. am i doing something wrong
baconsalt35 7 Nov, 2022 @ 1:12pm 
adding custom viewmodels via filename would be awesome.
Lucky Pineapple 10 Feb, 2022 @ 5:23pm 
2021 me was not good at reading instructions
Constable Reginald  [author] 9 Feb, 2022 @ 11:31pm 
@Lucky Pineapple.... did you not read the instructions about bullet time? If you set it 1 everything goes back to normal time
Lucky Pineapple 13 Feb, 2021 @ 10:20am 
why does it make everything super slow when i right click, same problem with the shotgun too. it will just slow everything down way too much and theres no fixing it
GTI-R666 5 Dec, 2020 @ 10:15am 
Rocket...Its DREAM🔥
mateothetrainguy 4 Oct, 2020 @ 5:53pm 
Q
bustomer service 6 Apr, 2019 @ 7:09am 
how do you pull up the menu?
Rob goblin. 29 Jan, 2019 @ 7:00pm 
wet
Constable Reginald  [author] 20 Jan, 2019 @ 12:40pm 
Wet or dry?