Hello, my name is Sandessat, and I want to ask, why do I get this error:
What I’m trying to do is a tween.
Here’s the complete code:
-- Services Variables
local starterGui = game:GetService("StarterGui")
local replicatedFirst = game:GetService("ReplicatedFirst")
local tweenService = game:GetService("TweenService")
replicatedFirst:RemoveDefaultLoadingScreen()
starterGui:SetCoreGuiEnabled("PlayerList", false)
starterGui:SetCoreGuiEnabled("Health", false)
starterGui:SetCoreGuiEnabled("Backpack", false)
starterGui:SetCoreGuiEnabled("Chat", false)
starterGui:SetCoreGuiEnabled("EmotesMenu", false)
-- Player GUI
local playerGUI = game.Players.LocalPlayer:WaitForChild("PlayerGui")
playerGUI:SetTopbarTransparency(0)
-- GUI Variable
local mainGameUI = script.mainGameUI:Clone()
mainGameUI.Parent = playerGUI
local mainScreen = mainGameUI.mainScreen
local loadingScreen = mainGameUI.loadingScreen
-- Variables
local aboutMeBB = mainScreen.aboutMeButton.buttonBackground
local contactMeBB = mainScreen.contactMeButton.buttonBackground
local helpBB = mainScreen.helpButton.buttonBackground
local manageAccountBB = mainScreen.manageAccountButton.buttonBackground
local aboutMeBBS = mainScreen.aboutMeButton.buttonBackgroundShadow
local contactMeBBS = mainScreen.contactMeButton.buttonBackgroundShadow
local helpBBS = mainScreen.helpButton.buttonBackgroundShadow
local manageAccountBBS = mainScreen.manageAccountButton.buttonBackgroundShadow
local aboutMeBL = mainScreen.aboutMeButton.buttonLabel
local contactMeBL = mainScreen.contactMeButton.buttonLabel
local helpBL = mainScreen.helpButton.buttonLabel
local manageAccountBL = mainScreen.manageAccountButton.buttonLabel
-- GUI Assets Variables
local loaTitle = loadingScreen.LoadingTitle
local loaDesc = loadingScreen.LoadingDesc
local loaDone = loadingScreen.LoadingDone
-- GUI Assets Tweens
local bBGoal = {
ImageTransparency = 0
}
local bBSGoal = {
ImageTransparency = 0
}
local bLGoal = {
TextTransparency = 0
}
local gBackgroundGoal = {
BackgroundTransparency = 1;
}
local loaTitleGoal = {
Position = UDim2.new(0.189, 0, 0.109, 0);
TextTransparency = 1;
}
local loaDescGoal = {
Position = UDim2.new(0.189, 0, 0.839, 0);
TextTransparency = 1;
}
local buttonsFrameInfo = TweenInfo.new(
2,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
0,
false,
0
)
local gBackgroundInfo = TweenInfo.new(
2,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
0,
false,
0
)
local loaTDInfo = TweenInfo.new(
2,
Enum.EasingStyle.Cubic,
Enum.EasingDirection.InOut,
0,
false,
0
)
local aboutMeBBTween = tweenService:Create(aboutMeBB, bBGoal, buttonsFrameInfo)
local contactMeBBTween = tweenService:Create(contactMeBB, bBGoal, buttonsFrameInfo)
local helpBBTween = tweenService:Create(helpBB, bBGoal, buttonsFrameInfo)
local manageAccountBBTween = tweenService:Create(manageAccountBB, bBGoal, buttonsFrameInfo)
local aboutMeBBSTween = tweenService:Create(aboutMeBBS, bBSGoal, buttonsFrameInfo)
local contactMeBBSTween = tweenService:Create(contactMeBBS, bBSGoal, buttonsFrameInfo)
local helpBBSTween = tweenService:Create(helpBBS, bBSGoal, buttonsFrameInfo)
local manageAccountBBSTween = tweenService:Create(manageAccountBBS, bBSGoal, buttonsFrameInfo)
local aboutMeBLTween = tweenService:Create(aboutMeBL, bLGoal, buttonsFrameInfo)
local contactMeBLTween = tweenService:Create(contactMeBL, bLGoal, buttonsFrameInfo)
local helpBLTween = tweenService:Create(helpBL, bLGoal, buttonsFrameInfo)
local manageAccountBLTween = tweenService:Create(manageAccountBL, bLGoal, buttonsFrameInfo)
local gBackgroundTween = tweenService:Create(mainGameUI.gameBackground, gBackgroundInfo, gBackgroundGoal)
local loaTTween = tweenService:Create(loaTitle, loaTDInfo, loaTitleGoal)
local loaDTween = tweenService:Create(loaDesc, loaTDInfo, loaDescGoal)
local loaDoTweenAppear = tweenService:Create(loaDone, TweenInfo.new(1), {
TextTransparency = 0;
})
local loaDoTweenDisappear = tweenService:Create(loaDone, TweenInfo.new(1), {
TextTransparency = 1;
})
repeat wait(1) until game:IsLoaded()
loaTTween:Play()
loaDTween:Play()
wait(3)
loaDoTweenAppear:Play()
wait(4)
loaDoTweenDisappear:Play()
wait(2)
if loadingScreen.Visible == true then
loadingScreen.Visible = false
mainGameUI.gameBackground.BackgroundTransparency = 0
mainScreen.Visible = true
gBackgroundTween:Play()
aboutMeBBTween:Play()
contactMeBBTween:Play()
helpBBTween:Play()
manageAccountBBTween:Play()
end