Skip to content

Commit

Permalink
better integration
Browse files Browse the repository at this point in the history
  • Loading branch information
TonybynMp4 committed May 23, 2024
1 parent 72b4973 commit 92fd7ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ local soundLoop = false

--Apprarently used by R* when drunk, makes car radio inaudible & adds reverb to everything
local function soundModeLoop()
if not config.useDrunkSoundMode then return end

soundLoop = true
CreateThread(function()
while soundLoop and alcoholLevel > 0 do
Expand Down Expand Up @@ -51,6 +53,11 @@ local function drunkLoop()

if severity then
drunkEffect(severity)
if not soundLoop and severity.toggleDrunkSounds then
soundModeLoop()
elseif soundLoop and not severity.toggleDrunkSounds then
soundLoop = false
end
end

Wait(60000 * sharedConfig.alcoholDecayTime)
Expand Down Expand Up @@ -121,9 +128,7 @@ AddStateBagChangeHandler('alcohol', ('player:%s'):format(cache.serverId), functi
end
alcoholLevel = value

if not soundLoop then
soundModeLoop()
elseif alcoholLevel <= 0 then
if alcoholLevel <= 0 then
soundLoop = false
end
end)
Expand Down
3 changes: 3 additions & 0 deletions config/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ return {
[2.0] = {
timecycle = 'Drunk',
shake = 0.75,
toggleDrunkSounds = true,
walk = 'move_m@drunk@moderatedrunk'
},
[3.0] = {
timecycle = 'spectator5',
shake = 1.25,
toggleDrunkSounds = true,
walk = 'move_m@drunk@a'
},
[4.0] = {
timecycle = 'spectator5',
shake = 2.0,
toggleDrunkSounds = true,
walk = 'MOVE_M@DRUNK@VERYDRUNK'
},
},
Expand Down

0 comments on commit 92fd7ec

Please sign in to comment.