To keep it simple the code makes a fade effect with gui’s.
Code
local erroed = 0 -- varible
local ScreenGui = game.StarterGui.Loading --(Screengui)
for i = 2,15 do
local function fire()
local find = ScreenGui:FindFirstChild(i-1)
if find then
local succes,res = pcall(function()
if find:IsA('GuiObject') then
local clone = find:Clone()
clone.Name = i
clone.Parent = find.Parent
local value = 255/i
clone.BackgroundColor3 = Color3.fromRGB(value,value,value)
clone.ZIndex = tonumber(clone.Name)
local dividedby = 1.1
local ws,wo = find.Size.Width.Scale, find.Size.Width.Offset
local hs,ho = find.Size.Height.Scale, find.Size.Height.Offset
clone.Size = UDim2.new(ws/dividedby ,wo/dividedby, hs/dividedby, ho/dividedby)
local findclone = find:Clone()
findclone:Destroy()
findclone.Size /= 2
local pos = findclone.Position
clone.Position = pos
end
end)
if succes then
erroed = 0
return res
else
if erroed ~= 2 then
if ScreenGui:FindFirstChild(i) then
ScreenGui:FindFirstChild(i):Destroy()
end
erroed += 1
fire()
else
print('The code has been forcefully shut down')
end
end
end
end
fire()
task.wait(0.5)
end
A simple video on how it looks: