Advertisement
Guest User

Untitled

a guest
Sep 20th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.51 KB | None | 0 0
  1. wait()
  2. -- Begin Variable Definition
  3.  
  4. local gui = script.Parent
  5. local buttons = script.Parent.buttonFrame
  6.  
  7. local launch = buttons.launchButton
  8. local about = buttons.aboutButton
  9. local rules = buttons.rulesButton
  10. local exitButton = buttons.exitButton
  11.  
  12. local aboutFrame = gui.aboutWindow
  13. local rulesFrame = gui.rulesWindow
  14.  
  15. local title = gui.title
  16. local titleGlow = gui.titleGlow
  17. local subtitle = gui.subtitle
  18. -- End Variable Definition
  19.  
  20. for i = 1,.4,-.075 do
  21.     gui.instructions.TextTransparency = i
  22.     wait()
  23. end
  24. print("Intro Complete!")
  25.  
  26. local mouse = game.Players.LocalPlayer:GetMouse()
  27.  
  28. mouse.KeyDown:connect(function(key)
  29.     if key:byte() == 13 then
  30.         wait()
  31.         for i = .4,1,.1 do
  32.             gui.instructions.TextTransparency = i
  33.             wait()
  34.         end
  35.         wait()
  36.         title:TweenPosition(UDim2.new(0, 0, .3, 0), "Out", "Quad", .3, false)
  37.         titleGlow:TweenPosition(UDim2.new(0, 0, .3, 0), "Out", "Quad", .3, false)
  38.         wait(.5)
  39.         subtitle:TweenPosition(UDim2.new(.05,0,.4,0), "Out", "Quad", .3, false)
  40.         wait(1)
  41.         buttons:TweenPosition(UDim2.new(.05,0,.6,0), "Out", "Quad", .3, false)
  42.     end
  43. end)
  44.  
  45.  
  46.  
  47.  
  48. function handleEnterGui(target)
  49.         local debounce = false
  50.         if not debounce then
  51.                 gui.beepEnter:play()
  52.                 debounce = true
  53.                 for i=.4,0,-.1 do
  54.                     target.buttonText.TextTransparency = i
  55.                     target.icon.ImageTransparency = i
  56.                     wait()
  57.                 end
  58.                 debounce = false
  59.         end
  60. end
  61.  
  62. function handleLeaveGui(target)
  63.         local debounce = false
  64.         if not debounce then
  65.                 debounce = true
  66.                 for i=0,.4,.1 do
  67.                     target.buttonText.TextTransparency = i
  68.                     target.icon.ImageTransparency = i
  69.                     wait()
  70.                 end
  71.                 debounce = false
  72.         end
  73. end
  74.  
  75. function frameSlideIn(target)
  76.     local debounce = false
  77.     if not debounce then
  78.         debounce = true
  79.         target:TweenPosition(UDim2.new(.4, 0, .2, 0), "Out", "Quad", .25, false)
  80.         wait(.25)
  81.         debounce = false
  82.     end
  83. end
  84.  
  85. function frameSlideOut(target)
  86.     local debounce = false
  87.     if not debounce then
  88.         debounce = true
  89.         target:TweenPosition(UDim2.new(1, 0, .2, 0), "Out", "Quad", .25, false)
  90.         wait(.25)
  91.         debounce = false
  92.     end
  93. end
  94.  
  95. launch.MouseEnter:connect(function()
  96.         handleEnterGui(launch)
  97. end)
  98.  
  99. rules.MouseEnter:connect(function()
  100.         handleEnterGui(rules)
  101. end)
  102.  
  103. about.MouseEnter:connect(function()
  104.         handleEnterGui(about)
  105. end)
  106.  
  107. exitButton.MouseEnter:connect(function()
  108.         handleEnterGui(exitButton)
  109. end)
  110.  
  111. --MOUSE LEAVE FUNCTIONS
  112. launch.MouseLeave:connect(function()
  113.     handleLeaveGui(launch)
  114. end)
  115.  
  116. rules.MouseLeave:connect(function()
  117.     handleLeaveGui(rules)
  118. end)
  119.  
  120. about.MouseLeave:connect(function()
  121.     handleLeaveGui(about)
  122. end)
  123.  
  124. exitButton.MouseLeave:connect(function()
  125.     handleLeaveGui(exitButton)
  126. end)
  127.  
  128. --MOUSE CLICK FUNCTIONS
  129. launch.MouseButton1Down:connect(function()
  130.     gui:destroy()
  131. end)
  132.  
  133. local aboutOpen = false
  134. local rulesOpen = false
  135.  
  136. about.MouseButton1Down:connect(function()
  137.     if aboutOpen then
  138.         aboutOpen = false
  139.         frameSlideOut(aboutFrame)
  140.     else
  141.         aboutOpen = true
  142.         frameSlideIn(aboutFrame)
  143.     end
  144. end)
  145.  
  146.  
  147. rules.MouseButton1Down:connect(function()
  148.     if rulesOpen then
  149.         rulesOpen = false
  150.         frameSlideOut(rulesFrame)
  151.     else
  152.         rulesOpen = true
  153.         frameSlideIn(rulesFrame)
  154.     end
  155. end)
  156.  
  157. exitButton.MouseButton1Down:connect(function()
  158.     game.Players.LocalPlayer:Kick()
  159. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement