Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I chose 0.05s because in my experience that's small enough that people will regard it as "smooth" but large enough that computers will have plenty of time to do work in it without lagging things up. But I also exposed it as a configuration in case people would want to change it, such as if they don't want a smooth player-speed recovery or if their server is doing a lot of things all the time and would like this to be less of a drain, even though Stopping Power doesn't have much of a performance hit.
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2424087277
I couldn't see any simple way of differentiating between armor damage or HP damage, but hopefully this is close enough.
local lastRecovTick = 0.0
local plys = player.GetAll()
hook.Add("Tick", "StoppingPowerRecovery", function()
if enabled then
local delta = CurTime() - lastRecovTick
if delta >= tickTime then
lastRecovTick = CurTime()
local recov = delta * recovAmt
for _, ply in ipairs(plys) do
if ply:Alive() then
local pRecovTick = ply:GetStopPowerRecoveryTime()
if pRecovTick and lastRecovTick >= pRecovTick then
ply:ChangeStopPowerSlowdownMult(recov, multMin)
end
end
end
end
end
end)
[Stopping Power - Damage slows you down] lua/autorun/sh_stoppower.lua:13: attempt to index global 'Math' (a nil value)
1. fn - lua/autorun/sh_stoppower.lua:13
2. unknown - lua/ulib/shared/hook.lua:109
[Stopping Power - Damage slows you down] lua/autorun/sh_stoppower.lua:13: attempt to index global 'Math' (a nil value)
1. fn - lua/autorun/sh_stoppower.lua:13
2. unknown - lua/ulib/shared/hook.lua:109 (x2)