I'm making a random, color intensive disco game & I wanted to merge a "few" scripts that is in startergui so I did that & it didn't work. Why & Any fix?
Code:
local loudness = music.PlaybackLoudness -- Thats the line that caused it to not work
runService.Heartbeat:Connect(function()
-- code
end)
Edit: I fixed it myself by moving the loudness variable into the heartbeat function.
Example:
runService.Heartbeat:Connect(function()
local loudness = music.PlaybackLoudness -- Now it works!
-- code
end)

4 comments
im no professional, but maybe try and put the while loop in a different script with the variables it needs
is this in a local script or a server script? Because you’re trying to call the local player, and changing things that should probably require a remote event, unless its something the player only wants to see?
It's a local script
no expert but do them 1 by 1 I wouldnt put em all together