Edited that part to this:
def self.sound(percent)
case percent
#when 100 then RPG::AudioFile.new(name, volume, pitch)
when 50
return RPG::AudioFile.new('Breathing', 90, 0)
when 0
return RPG::AudioFile.new('Heavy Breathing', 100, 0)
end
return nil
end
end
Made it work but then I got a different error on this line:
se = StandWalkRun.sound(StandWalkRun::Run_points/@run_points)
Error:
ZeroDivisionError occurred.
divided by 0.
(Same error happen with your version)
I only managed to make it "work" once, it was kinda nice tough for some reason before the sound started the game froze for a second and when I had enough stamina again the sound instantly stopped instead of slowly fading unless this was intentional.
Ps. I was wondering if the sound plays only when it reaches 50% and stops or it's 50% or less? I should have been more specific in my first post as I want the latter >_<