Garry's Mod

Garry's Mod

397 ratings
Oxygen and Stamina System (And Flashlight Battery)
3
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Realism
File Size
Posted
Updated
2.452 MB
11 Jan, 2021 @ 11:32am
12 Aug, 2023 @ 12:40pm
16 Change Notes ( view )

Subscribe to download
Oxygen and Stamina System (And Flashlight Battery)

In 5 collections by Rad Poseidon
Oh No Generation 5
237 items
Oh No: Generation 6
254 items
Help Me
317 items
あああああっ!!!
239 items
I've run out of names
290 items
Description
Attention
Before you make a post about the new update breaking things, please make sure you've changed the addon settings first. Your old settings will not work!


I apologize for the horrendous video quality before hand, OBS doesn't like my Garry's Mod

If you're anything like me, you probably don't like the existing Suit Power system. Drowning because you left your flashlight on isn't exactly realistic, but at the same time neither is breathing forever.

The Solution? An addon that adds Oxygen, Sprint Stamina and the Flashlight Battery as separate values independent of one another. This addon.

Features
  • Three Separate Modules for Oxygen, Stamina and Flashlight Battery that can be turned on independently of on another
  • Running Out of Stamina prevents the player from sprinting (And Jumping too if you want)
  • Running Out of Oxygen causes the player to drown at a configurable rate
  • Running out of Flashlight Battery uhh... Turns your flashlight off
  • Configurable Settings for How Fast Each module runs out and regenerates
  • Configurable HUD Pos and Size for each meter

Config
Variable
What It Does
sv_oxygen_maxoxygen
How Much Oxygen The Player Has
sv_oxygen_recoveramount
The Rate at Which to Recover Oxygen
sv_oxygen_damage_timer
How often to damage a drowning player
sv_oxygen_damage_amount
How much to damage a drowning player
sv_stamina_recoveramount
The rate at which to recover stamina
sv_stamina_recovertime
How long after the player stops sprinting/jumping to start recovering stamina
sv_stamina_sprint_at
How much stamina the player needs to sprint, this will not come in to effect if they are already sprinting
sv_stamina_jumpcost
How much stamina jumping uses
sv_stamina_jumplimited
Whether or not you need stamina to jump
sv_stamina_swimuses
If and how much stamina swimming uses
sv_flashlight_maxbattery
How Much Battery the flashlight has
All Config options are under the tool menu at
Oxygen & Stamina => Server

If you have any suggestions, or run into any bugs, please start a discussion prefixed with [Bug] or [Suggestion] respectively

Planned Features
  • Improve the manipulation hooks
  • Add more configuration to the low stamina and oxygen effects
  • Add configurable panting sounds for running and coming out of the water

A special thanks to the members of the Garry's Mod Discord for helping me debug some things my moronic self couldn't have alone
Popular Discussions View All (7)
19
20 Jan, 2021 @ 6:41pm
[Bug] The bars don't display.
CollChuuk
1
12 Aug, 2023 @ 12:43pm
[Bug] High values broken
wiimeiser
1
17 Aug, 2024 @ 2:03pm
[Suggestion] Faster stamina usage based on remaining health
Khanical
127 Comments
NyanCatGamer02 17 hours ago 
oh my god, I never knew I needed this until I subscribed to it, great job!!!
CyanStar 11 Jun @ 12:10am 
I love this addon, with my only real suggestion being maybe a way to assign different values for each slider to different players like you run out of stamina faster but others run out slower. Idk how difficult that would be to code tho-
sleepingpilot 3 May @ 3:46pm 
actually really underrated
MonoBoca 7 Feb @ 8:17pm 
i cant save configs:steamsad:
Sevka Slav 27 Jan @ 4:01pm 
meh fine, btw this mod of yours is hella cool, saying this so you feel good
is it possible someday for you to add UI modifications to it? I would like it to look more gritty and STALKER 2 like or dark instead of cartoony blue and green, not that I have a problem
Rad Poseidon  [author] 27 Jan @ 2:08pm 
I'm saying that it's on the creator of that mod. The code isn't open source so I'd have to unpackage it, and I don't think it's worth it to add compatibility for a specific mod when the developer of that one could have and should have just edited the player metatable to modify Player:FlashlightIsOn()
Sevka Slav 23 Jan @ 4:29pm 
... no I swear it does not use up the battery, besides I noticed this mod all it does is just paste a flashlight texture... which kinda sucks... but the animation is great
Sevka Slav 23 Jan @ 4:25pm 
wait, oh... sorry, hmm I don't know, when I used this, the flashlight battery hasn't gone done
Sevka Slav 23 Jan @ 4:25pm 
are you saying you could make a compatibility for this?
Rad Poseidon  [author] 23 Jan @ 4:08pm 
This addon uses GMod's default flashlight hooks to work. It's entirely possible for that mod to tie into them instead, which is what they should do.