Advertisement
HowToRoblox

IntroHandler

Jun 19th, 2020
1,640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1. local screenGui = script.Parent.Parent
  2. screenGui.IgnoreGuiInset = true
  3. screenGui.Enabled = true
  4.  
  5. local bg = screenGui:WaitForChild("Background")
  6.  
  7. local logo = bg:WaitForChild("Logo")
  8. local uiGradient = logo:WaitForChild("UIGradient")
  9.  
  10. local playBtn = bg:WaitForChild("PlayButton")
  11. local hasClickedPlay = false
  12.  
  13. playBtn.Position = UDim2.new(0.5, 0,1, 0)
  14. uiGradient.Offset = Vector2.new(0, 0)
  15.  
  16. local tweenService = game:GetService("TweenService")
  17. local tweenInfoFade = TweenInfo.new(6, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
  18. local tweenInfoHover = TweenInfo.new(0.2, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
  19.  
  20. local fadeInTween = tweenService:Create(uiGradient, tweenInfoFade, {Offset = Vector2.new(0, -1)})
  21. fadeInTween:Play()
  22.  
  23. fadeInTween.Completed:Wait()
  24. wait(0.2)
  25.  
  26. playBtn:TweenPosition(UDim2.new(0.5, 0,0.741, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 1)
  27.  
  28. wait(1)
  29.  
  30. playBtn.MouseButton1Click:Connect(function()
  31.    
  32.     if hasClickedPlay then return end
  33.     hasClickedPlay = true
  34.    
  35.     bg:TweenPosition(UDim2.new(0.5, 0, -0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 5)
  36.    
  37.     wait(5)
  38.    
  39.     bg.Parent:Destroy()
  40. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement