Hello everyone, I am attempting to make a vehicle sound script using the RPM and want to use a different audio every 1000 rpm instead of one audio that constantly changes pitch as you can hear more of the changes the engine makes every rpm.
I currently use the sub 1000 numbers as the interlude part and the 1000s to decide which audio should play like this:
local function Sounds(lwrrpm, hrrpm, RPMC, Throttle)
for i,v in pairs(SoundModel:GetDescendants())do
if v.Name~="BOV" and v.Name~="Boost" and v:IsA("Sound") then
v.Volume=0
end
if Throttle>=0.5 then
if v.Name==tostring(hrrpm).."L" then
v.Volume=SoundData.SoundData[hrrpm].Volume*(RPMC/500)
v.DIST.Level=SoundData.SoundData[hrrpm].Distortion
v.PITC.Octave=1-(RPMC/2500)
elseif v.Name==tostring(lwrrpm).."L" then
v.Volume=SoundData.SoundData[lwrrpm].Volume
v.DIST.Level=SoundData.SoundData[lwrrpm].Distortion
v.PITC.Octave=1+(RPMC/2500)
end
else
if v.Name==tostring(hrrpm).."C" then
v.Volume=SoundData.SoundData[hrrpm].Volume*(RPMC/500)
v.DIST.Level=SoundData.SoundData[hrrpm].Distortion
v.PITC.Octave=1-(RPMC/2500)
elseif v.Name==tostring(lwrrpm).."C" then
v.Volume=SoundData.SoundData[lwrrpm].Volume
v.DIST.Level=SoundData.SoundData[lwrrpm].Distortion
v.PITC.Octave=1+(RPMC/2500)
end
end
end
end
I am also using C to use the audio when there is no throttle being applied and L is for load which means there is throttle being applied. hrrpm is the current rpm +1 and lwrrpm is the current rpm. this is what it sounds like which really makes me think i used the sound an UFO would make
yes i know it sounds bad but thats why im asking the smart people. WARNING IT MAY BE LOUD
I thank you for investing time reading all of my stupidity