So i’m making a radio where if you click it the playbackspeed goes down using tween, Making an effect of it slowly turning off.
Somehow i get “Unable to cast to Dictionary” at the tweenservice:create() lines.
local TweenService = game:GetService("TweenService")
local TweenInf = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0)
local Off = true
local TurnOn = TweenService:Create(script.Parent.Music.PlaybackSpeed, TweenInf, 1)
local TurnOff = TweenService:Create(script.Parent.Music.PlaybackSpeed, TweenInf, 0)
script.Parent.ClickDetector.MouseClick:Connect(function(clicker)
if Off == true then
script.Parent.Music:Play()
TurnOn:Play()
TurnOn.Completed:wait()
Off = false
elseif Off == false then
Off = true
TurnOff:Play()
TurnOff.Completed:wait()
script.Parent.Music:Pause()
Off = true
end
end)
I don’t know how to fix this, I have tried asking my friends but they don’t know either.
https://gyazo.com/855c30fa9b41588a3b347271b9faed74
(Line 6 is the tweenservice:create() lines)