I’m currently making a loading screen and I wanted to add random text froma table as tips on the bottom of the loading screen. It seems to error at the tips with the error “Unable to assign property Text. string expected, got boolean”.
-------- SERVICES --------
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
-------- LOADING UI --------
local Loading = Instance.new("ScreenGui")
Loading.Name = "Loading"
Loading.Parent = Players.LocalPlayer.PlayerGui
local LoadingFrame = Instance.new("Frame") -- Frame itself
LoadingFrame.Name = "LoadingFrame"
LoadingFrame.Size = UDim2.new(1, 0, 1, 0)
LoadingFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
LoadingFrame.AnchorPoint = Vector2.new(0.5, 0.5)
LoadingFrame.Parent = Loading
local Gradient = script:FindFirstChild("Dark") --Gradient for loading BG
Gradient.Parent = LoadingFrame
local Tip = Instance.new("TextLabel")
Tip.Parent = LoadingFrame
Tip.TextColor3 = Color3.new(0.917647, 0.988235, 1)
Tip.BackgroundTransparency = 1
Tip.Size = UDim2.new(0.312, 0, 0.085, 0)
Tip.Position = UDim2.new(0.334, 0, 0.746, 0)
local PossibleTips = {
"preset tip" == 1,
"Tip 2" == 2,
"Tip 3" == 3
}
tip = math.random(1, 3)
if tip == 1 then
Tip.Text = PossibleTips[1]
elseif tip == 2 then
Tip.Text = PossibleTips[2]
elseif tip == 3 then
Tip.Text = PossibleTips[3]
end
local Logo = Instance.new("ImageLabel") -- Center Logo
Logo.BackgroundTransparency = 1
Logo.Image = "rbxassetid://98283397969117"
Logo.ImageColor3 = Color3.new(255, 0, 0)
Logo.Position = UDim2.new(0.401, 0, 0.324, 0)
Logo.Size = UDim2.new(0.197, 0, 0.354, 0)
Logo.Parent = LoadingFrame
local Constraint = script:FindFirstChild("UIAspectRatioConstraint")
Constraint.Parent = Logo
local Red = script:FindFirstChild("Red") -- Gradient 2
Red.Parent = Logo and Tip
-------- ROTATION --------
task.spawn(function()
while Loading and Loading.Parent do
Logo.Rotation = (Logo.Rotation >= 360 and 0) or Logo.Rotation + 2
task.wait()
end
end)
ReplicatedFirst:RemoveDefaultLoadingScreen()
-------- TWEENING --------
task.wait(5)
local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local FrameTween = TweenService:Create(LoadingFrame, tweenInfo, {Transparency = 1})
local LogoTween = TweenService:Create(Logo, tweenInfo, {Transparency = 1})
FrameTween:Play()
LogoTween:Play()
FrameTween.Completed:Wait()
LogoTween.Completed:Wait()
Loading:Destroy()