Advertisement
Pro1234jgvf_YT

How to make a Roblox Loading Screen

Jun 30th, 2023
1,902
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.08 KB | None | 0 0
  1. ---------------------------------------<<<<<<[::Loading Screen Script::]>>>>>>---------------------------------------------------------
  2.  
  3. local Players = game:GetService("Players")
  4. local ReplicatedFirst = game:GetService("ReplicatedFirst")
  5. local TweenService = game:GetService("TweenService")
  6.  
  7.  
  8. local player = Players.LocalPlayer
  9. local playerGui = player:WaitForChild("PlayerGui")
  10.  
  11. print("Service Successful")
  12.  
  13. local ScreenGui = Instance.new("ScreenGui")
  14. ScreenGui.IgnoreGuiInset = true
  15. ScreenGui.Parent = playerGui
  16.  
  17. print("ScreenGui Successful")
  18.  
  19. local frame = Instance.new("Frame")
  20. frame.Parent = ScreenGui
  21. frame.Size = UDim2.new(1,0,1,0)
  22. frame.BackgroundTransparency = 0
  23. frame.BackgroundColor3 = Color3.fromRGB(0,20,40)
  24.  
  25. print("frame Successful")
  26.  
  27. local textLabel = Instance.new("TextLabel")
  28. textLabel.Size = UDim2.new(1,0,1,0)
  29. textLabel.BackgroundColor3 = Color3.fromRGB(0,20,40)
  30. textLabel.Font = Enum.Font.GothamBold
  31. textLabel.TextColor3 = Color3.new(.8,.8,.8)
  32. textLabel.Text = "Loading"
  33. textLabel.TextSize = 28
  34. textLabel.Parent = frame
  35.  
  36. print("TextLabel Successful")
  37.  
  38. local loadingRing = Instance.new("ImageLabel")
  39. loadingRing.Size = UDim2.new(0,256,0,256)
  40. loadingRing.BackgroundTransparency = 1
  41. loadingRing.Image = "rbxassetid://4965945816"
  42. loadingRing.AnchorPoint = Vector2.new(0.5,0.5)
  43. loadingRing.Position = UDim2.new(0.5,0,0.5,0)
  44. loadingRing.Parent = frame
  45.  
  46. print("LoadingRing Successful")
  47.  
  48. ReplicatedFirst:RemoveDefaultLoadingScreen()
  49.  
  50. print("Remove Deafult loading screen Unsuccessful")
  51.  
  52. local tweenInfo = TweenInfo.new(4,Enum.EasingStyle.Linear,Enum.EasingDirection.In,-1)
  53. local tween = TweenService:Create(loadingRing,tweenInfo,{Rotation = 360})
  54.  
  55. print("TweenService Successful")
  56.  
  57. tween:Play()
  58.  
  59. wait(5)
  60. if not game:IsLoaded() then
  61.     game.Loaded:Wait()
  62. end
  63.  
  64. loadingRing.Visible = false
  65. frame:TweenPosition(UDim2.new(0,0,1,0),"InOut","Sine",2)
  66. wait(2)
  67. ScreenGui:Destroy()
  68.  
  69. print("Loaded LoadingScreen")
  70. print("Script Successful")
  71.  
  72. ------------------------------<<<<<<<<<<<<<<<^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^>>>>>>>>>>>>>>>-----------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement