I am making a music visualizer, and this script works perfect in studio, but when I go into an actual game it doesn't work.
there are no errors either.
Code:
wait(1)
local ts = game:GetService("TweenService")
local music = workspace:WaitForChild("Music")
local lookAt = workspace:WaitForChild("lookAt")
while wait() do
local bass = math.ceil(music.PlaybackLoudness/6)
local props = {
Color = Color3.fromRGB(math.random(bass, 255),math.random(bass, 255),math.random(bass, 255));
Size = Vector3.new(bass,bass,bass);
Orientation = Vector3.new(0,0,-175)
}
if (bass < 25) then
props.Orientation = Vector3.new(0,0,140)
elseif (bass > 25) then
props.Orientation = Vector3.new(0,0,-175)
end
local tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 1, false)
local tween = ts:Create(lookAt, tweenInfo, props)
tween:Play()
lookAt.ParticleEmitter.Color = ColorSequence.new(Color3.fromRGB(math.random(bass, 255),math.random(bass, 255),math.random(bass, 255)), Color3.fromRGB(math.random(bass, 255),math.random(bass, 255),math.random(bass, 255)))
lookAt.ParticleEmitter.Rate = bass
end

3 comments
Is it a local script? Inside a part?
PlaybackLoudness cannot be read from the server.
@CPF2 Thank you so much, it helped, I didn't know that PlaybackLoudness couldn't be read from the server, if you make an answer I will accept it, and upvote your comment