#does anyone know how to make this do the opposite of what its doing rn
1 messages · Page 1 of 1 (latest)
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Sound = script:WaitForChild("Sound")
local Percent_Of_Health = .99
local function Fade_Music_In()
for i = Sound.Volume, 1, .1 do
Sound.Volume = i
wait(.3)
end
end
local function Fade_Music_Out()
for i = Sound.Volume, 0, -.1 do
Sound.Volume = i
wait(.3)
end
end
Player.CharacterAdded:connect(function(character)
if character ~= nil then
local Humanoid = character:WaitForChild("Humanoid")
Humanoid.HealthChanged:connect(function(health)
if health < (Humanoid.MaxHealth * Percent_Of_Health) and health ~= 0 then
if not Sound.IsPlaying then
Sound:Play()
Humanoid.WalkSpeed = 10
Fade_Music_In()
end
else
if health > (Humanoid.MaxHealth * Percent_Of_Health) then
if Sound.IsPlaying then
Humanoid.WalkSpeed = 16
Fade_Music_Out()
Sound:Pause()
end
else
if health == 0 then
if Sound.IsPlaying then
Fade_Music_Out()
Sound:Stop()
end
end
end
end
end)
end
end)
Is this chat gpt
ah
im not smart enough to brainstorm it on my own and
i feel bad harassing my friend for help with all of this