local part = workspace:WaitForChild('TRIAGE')
local setColor = Color3.fromRGB(75, 43, 255)
local clr_black = Color3.new() --empty constructor means black
res.Heartbeat:Connect(function()
local song = _G.PlayingSong
if song and song.IsPlaying then --make sure there's actually a song playing first
local alpha = song.PlaybackLoudness * .001 --divide by 1000 to normalize the number since PlaybackLoudness is a number ranging from 0 to 1000
part.Color = clr_black:Lerp(setColor, alpha)
end
end)
this is what i have as my entire color change script. i did a few print functions and the hearbeat is working, the song just isnt playing.
Probably because the volume isnât high enough. The color will only reach setColor when the sound is at its absolute maximum allowed by Roblox. You can change the way it normalizes the audio, maybe the set the cap lower?
local alpha = song.PlaybackLoudness * .01 --try dividing by 100 instead of 1000
Did you check if this enclosed snippet is running?
if song and song.IsPlaying then
... --the inside
end
If it isnât try printing out _G.PlayingSong to see if the songâs even there
Also try printing out both alpha and song.PlaybackLoudness and see if the numbers are reasonable
yeah so i did put a print inside the âif song and song.isplayingâ part and it was working. for the alpha and playback loudness parts, how would i print those properly?
local alpha = song.PlaybackLoudness * .001
print(song.PlaybackLoudnes)
print(alpha) --should be a number in between 0 and 1, keep in mind that 1 is the max volume
Print them out and see if the numbers are âappropriateâ