Hey! I’m working on a Loading Bar for my main menu but I’ve ran into a problem. After scripting the tween’s, it says “Unable to cast double to token” when I go to test it out.
Here’s the error:
Here’s the script:
local loadingBar = script.Parent
local tweenService = game:GetService("TweenService")
local img = loadingBar.Parent.ImageLabel
local mainFrame = loadingBar.Parent.Parent.Parent.MainMenu.MainFrame
local playBtn = mainFrame.PlayButton
local settingsBtn = mainFrame.SettingsButton
local creditsBtn = mainFrame.CreditsButton
local titleImg = mainFrame.Title
wait(3)
loadingBar:TweenSize(UDim2.new(0.041, 0,0.04, 0), 1)
wait(2)
loadingBar:TweenSize(UDim2.new(0.217, 0,0.04, 0), 3) -- line 14
wait(4)
loadingBar:TweenSize(UDim2.new(0.555, 0,0.04, 0), 1)
wait(3)
loadingBar:TweenSize(UDim2.new(0.728, 0,0.04, 0), 2)
wait(4)
if not game:IsLoaded() then
game.Loaded:Wait()
else
loadingBar:TweenSize(UDim2.new(0.908, 0,0.04, 0), 2)
wait(3)
loadingBar:TweenPosition(UDim2.new(0.058, 0,2, 0), 1)
img:TweenPosition(UDim2.new(0.027, 0,2, 0), 1)
wait(1)
titleImg:TweenSize(UDim2.new(0, 751,0, 500), 1)
titleImg:TweenPosition(UDim2.new(0.272, 0,-0.061, 0), 1)
playBtn:TweenPosition(UDim2.new(0.5, 0,0.5, 0), 1)
settingsBtn:TweenPosition(UDim2.new(0.5, 0,0.652, 0), 1)
creditsBtn:TweenPosition(UDim2.new(0.5, 0,0.797, 0), 1)
end
Any help will do! Thanks!