Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. game:GetService('ReplicatedFirst'):RemoveDefaultLoadingScreen()
  2.  
  3. local screen = script.Parent:WaitForChild('Loading'):Clone()
  4. screen.Parent = game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui')
  5. local Ready = game.Workspace:WaitForChild("Ready", true)
  6. while (game.ContentProvider.RequestQueueSize > 0) do wait(0) end
  7. local fadein, fadeout, images = 2, 1, { }
  8. images[1] = screen:WaitForChild('ImageLabel1'),
  9. images[2] = screen:WaitForChild('ImageLabel2')
  10.  
  11. function tweenImageTrans(image, inout)
  12. coroutine.resume(coroutine.create(function()
  13. if (inout == 'In') then
  14. for i = 1, 0.05, -0.05 do
  15. image.ImageTransparency = i
  16. wait(0)
  17. end
  18. image.ImageTransparency = 0
  19. elseif (inout == 'Out') then
  20. for i = 0.05, 1, 0.05 do
  21. image.ImageTransparency = i
  22. wait(0)
  23. end
  24. image.ImageTransparency = 1
  25. end
  26. end))
  27. end
  28.  
  29. while (not Ready.Value) do
  30. if (fadein == 2) then
  31. fadein, fadeout = 1, 2
  32. elseif (fadein == 1) then
  33. fadein, fadeout = 2, 1
  34. end
  35. tweenImageTrans(images[fadeout], 'Out')
  36. delay(1, function()
  37. tweenImageTrans(images[fadein], 'In')
  38. end)
  39. wait(30)
  40. end
  41.  
  42. repeat wait(0) until (Ready ~= nil and Ready.Value == true)
  43. screen:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement