Garry's Mod

Garry's Mod

87 ratings
Physgun Fizzle
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun
File Size
Posted
Updated
13.331 KB
10 May, 2020 @ 1:59am
16 May, 2020 @ 3:59pm
4 Change Notes ( view )

Subscribe to download
Physgun Fizzle

Description
What is this?
If you are tired of people building during a battle, and want an organic way to disable that, Physgun Fizzle is for you.

Whenever the player holding something or the held entity took damage, there is a chance that the Physics Gun gets temporarily disabled. When disabled, you cannot drag, freeze or unfreeze with the physgun until a few seconds has passed. This is useful in roleplay or basebuilding gamemodes like DarkRP, BaseWars and PvP-oriented Sandbox servers.

Configuration
You can configure using the options menu, or use the below ConVars.
physfiz_enabled - Set to 0 to disable the features in this addon. Default 1 sv_physfiz_chance_playerhit - The chance of fizzling when the player is shot. Default 0.8 sv_physfiz_chance_prophit - The chance of fizzling when the prop held by the player is shot. Default 0.5 sv_physfiz_chance_damagethreshold - The minimum damage below which the chance of fizzling is reduced. Default 10 sv_physfiz_chance_damagethreshold_linear - Whether to linearly reduce chance when damage is low. If set to 0, damage below threshold will have no chance. Default 1 sv_physfiz_timemin - Minimum amount of time to disable the physgun. Default 7 sv_physfiz_timemax - Maximum amount of time to disable the physgun. Default 10 sv_physfiz_pvponly - Whether only player damage will cause fizzling. Default 0 sv_physfiz_blockprop - "Whether fizzling also blocks prop spawning. Default 1 sv_physfiz_unjam - Whether you can mash keys to unjam the physgun quicker. Default 0 sv_physfiz_unjam_amount - The amount of fizzle time to reduce per button press. Default 0.1 cl_physfiz_sounds - Whether to enable spark sounds. Default 1 cl_physfiz_whiteflash - Whether to force other players' disable flash be white (weapon color can be hard to see). Default 1

Developer Info
SERVER HOOK: PhysgunFizzleChance(ply, isProp, chance) Calls before the addon calculates a chance to disable physgun. Return a value between 0 and 1 to override the default chance. SHARED FUNCTION: Player:IsPhysgunFizzling() Returns true if fizzling is active and false otherwise. SHARED FUNCTION: Player:AddPhysgunFizzle(t, override) Start fizzling. If override is true, clears previous fizzling time; otherwise adds to it.

If you think this is a cool idea, Thumbs Up to let others see it too, or Favorite it for later!
12 Comments
>KB> >KEKSQUAD 29 Mar, 2024 @ 3:25pm 
Hey if anyone here is interested in a fix, you can decompile this addon and move the sv_physfiz_unjam CreateConvar line in sh_config.lua BEFORE the "if SERVER then" line; this makes the convar "known" to clients, but unchangeable by clients. The reason that the Lua error in the original occurs is due to the convar not being "known" to clients. I have previously tested this on my server after an Antlion Guard hit me when I had my physgun out, and it appears to work fine without errors.
cumpuddle228 26 Aug, 2023 @ 10:54am 
if works jus PLZ get rid of the lua error every time it works its annoying af
Veldigoob 18 Jan, 2023 @ 8:21am 
lmao finally i found the anti propkiller addon
Tye-Wynd 1 Aug, 2021 @ 12:30pm 
i need one so i can give a prop some sort of effect where only I (the person who activated it) can use the physgun on, but, its a good addon!
Nephrite Harmony 5 Mar, 2021 @ 8:56pm 
phyzzlegun
>KB> >KEKSQUAD 26 Oct, 2020 @ 10:01pm 
[ERROR] lua/physgunfizzle/sh_fizzle.lua:25: attempt to index a nil value
1. fn - lua/physgunfizzle/sh_fizzle.lua:25
2. unknown - lua/ulib/shared/hook.lua:109
>KB> >KEKSQUAD 14 Oct, 2020 @ 3:00pm 
Boi that is more complicated that it sounds
8Z  [author] 16 May, 2020 @ 2:52pm 
@AppleJack Good idea - let me try implementing that.
8Z  [author] 15 May, 2020 @ 3:17am 
@stevensky That shouldn't be difficult to implement.
stevensky 15 May, 2020 @ 1:49am 
would be nice if fizzled players couldn't spawn props as well, nice addon!