Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't TweenService working in-game, only studio?

Asked by
sad_eyez 162
6 years ago

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
0
Is it a local script? Inside a part? hellmatic 1523 — 6y
1
PlaybackLoudness cannot be read from the server. CPF2 406 — 6y
0
@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 sad_eyez 162 — 6y

Answer this question