Guest User

Untitled

a guest
Feb 9th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.64 KB | None | 0 0
  1. -- Variables
  2. local player = game.Players.LocalPlayer
  3. local char = player.Character or player.CharacterAdded:wait()
  4. local mouse = player:GetMouse()
  5. local camera = workspace.CurrentCamera
  6. local RepStore = game.ReplicatedStorage
  7.  
  8. local ContentProvider = game:GetService("ContentProvider")
  9. local RunService = game:GetService("RunService")
  10. local TweenService = game:GetService("TweenService")
  11. local UserInput = game:GetService("UserInputService")
  12.  
  13. local network = {}
  14. local screen = {}
  15.  
  16. local gui = script.Parent
  17. local Audio = gui.Audio
  18. local Main = gui.Main
  19.  
  20. do -- screen
  21. function screen.new(color,caller)
  22. print("SCREEN CALLER",caller)
  23. local frame = Instance.new("Frame")
  24. frame.Size = UDim2.new(1,0,1.1,0)
  25. frame.Position = UDim2.new(0,0,-0.1,0)
  26. frame.BorderSizePixel = 0
  27. frame.BackgroundTransparency = 1
  28. frame.BackgroundColor3 = color
  29. frame.Parent = gui
  30.  
  31. local Events = {
  32. In = function(time) TweenService:Create(frame,TweenInfo.new(time),{BackgroundTransparency = 0}):Play() end,
  33. Out = function(time) TweenService:Create(frame,TweenInfo.new(time),{BackgroundTransparency = 1}):Play() wait(time) frame:Destroy() end
  34. }
  35.  
  36. return Events
  37. end
  38. end
  39.  
  40. -- Loading Screen
  41. spawn(function()
  42. local Intro = gui["Loading Screen"]
  43. Main.Visible = false
  44. Intro.Black.Visible = true
  45. Intro.clip.Visible = true
  46. Intro.clip.Background_.Visible = true
  47. Audio.Intro:Play()
  48. while ContentProvider.RequestQueueSize > 0 do
  49. Intro.clip.Background_.Image = "rbxgameasset://Images/loading1"
  50. wait(0.5)
  51. Intro.clip.Background_.Image = "rbxgameasset://Images/loading2"
  52. wait(0.5)
  53. Intro.clip.Background_.Image = "rbxgameasset://Images/loading3"
  54. wait(0.5)
  55. end
  56. wait(1)
  57.  
  58. Intro.clip.Background_:TweenPosition(UDim2.new(0.5,0,1.5,0), "Out", "Quad", .5)
  59. wait(.5)
  60. Main.Visible = true
  61. TweenService:Create(Intro.Black,TweenInfo.new(0.5),{ImageTransparency = 1}):Play()
  62. end)
  63.  
  64. -- Initial shit
  65. for i,v in pairs(Main:GetChildren()) do
  66. if v:IsA("ImageButton") then
  67. v.MouseEnter:Connect(function()
  68. v.Size = v.Size + UDim2.new(0,10,0,10)
  69. v.Position = v.Position - UDim2.new(0,5,0,5)
  70. end)
  71.  
  72. v.MouseLeave:Connect(function()
  73. v.Size = v.Size - UDim2.new(0,10,0,10)
  74. v.Position = v.Position + UDim2.new(0,5,0,5)
  75. end)
  76. end
  77. end
  78.  
  79. -- Menu shit
  80. local inMenu = true
  81.  
  82. local Run = RunService.RenderStepped:Connect(function()
  83. gui.Cursor.Position = UDim2.new(0,mouse.X,0,mouse.Y)
  84. UserInput.MouseIconEnabled = false
  85. end)
  86.  
  87. spawn(function()
  88. while inMenu do
  89. local particle = Instance.new("Frame")
  90. particle.AnchorPoint = Vector2.new(0.5,0.5)
  91. particle.BackgroundColor3 = Color3.new(1,1,1)
  92. particle.BorderSizePixel = 0
  93. particle.Size = UDim2.new(0,5,0,5)
  94. particle.Position = UDim2.new(0,mouse.X,0,mouse.Y)
  95. particle.Parent = gui.Particles
  96.  
  97. TweenService:Create(particle,TweenInfo.new(0.3),{BackgroundTransparency = 1,Rotation = math.random(-45,45)}):Play()
  98. game:GetService("Debris"):AddItem(particle,0.22)
  99. RunService.RenderStepped:wait()
  100. end
  101. end)
  102.  
  103. local Modes = {
  104. ["Normal"] = {
  105. ImageID = "rbxgameasset://Images/coollogo_com-2583920",
  106. Size = UDim2.new(0,500,0,60),
  107. Start = Main.Play.Position + UDim2.new(0,0,0,50),--UDim2.new(math.random(),0,-0.2,0),
  108. OnClick = function()
  109. Audio.Intro:Stop()
  110. inMenu = false
  111. Main.Visible = false
  112. repeat workspace.CurrentCamera.CameraType = Enum.CameraType.Custom wait() until workspace.CurrentCamera.CameraType == Enum.CameraType.Custom
  113. local Screen = screen.new(Color3.new(1,1,1),"Modes")
  114. Screen.In(0.5)
  115. wait(2)
  116. Screen.Out(0.5)
  117. end
  118. },
  119. ["User Made Levels (WIP)"] = {
  120. ImageID = "rbxgameasset://Images/coollogo_com-11542288",
  121. Size = UDim2.new(0,400,0,65),
  122. Start = Main.Play.Position + UDim2.new(0,0,0,50),--UDim2.new(math.random(),0,-0.2,0),
  123. OnClick = function()
  124.  
  125. end
  126. },
  127. ["Race (WIP)"] = {
  128. ImageID = "rbxgameasset://Images/gamemode_race_1",
  129. Size = UDim2.new(0,500,0,65),
  130. Start = Main.Play.Position + UDim2.new(0,0,0,50),--UDim2.new(math.random(),0,-0.2,0),
  131. OnClick = function()
  132.  
  133. end
  134. },
  135. }
  136.  
  137. local open = false
  138. Main.Play.MouseButton1Click:Connect(function()
  139. Audio.ButtonClick:Play()
  140.  
  141. if not open then
  142. open = true
  143. local last = Main.Play.Position + UDim2.new(0,15,Main.Play.Size.Y.Scale,Main.Play.Size.Y.Offset)
  144.  
  145. for i,v in pairs(Modes) do
  146. if not Main:FindFirstChild(i) then
  147. local btn = Instance.new("ImageButton")
  148. btn.BackgroundTransparency = 1
  149. btn.ImageTransparency = 1
  150. btn.Name = i
  151.  
  152. btn.Image = v.ImageID
  153. btn.Size = v.Size
  154. btn.Position = v.Start
  155. TweenService:Create(btn,TweenInfo.new(0.5),{Position = last, ImageTransparency = 0}):Play()
  156. last = last + UDim2.new(0,0,btn.Size.Y.Scale,btn.Size.Y.Offset + 15)
  157. btn.Parent = Main
  158.  
  159. btn.MouseButton1Click:Connect(v.OnClick)
  160. wait(.1)
  161. else
  162. local btn = Main:FindFirstChild(i)
  163. TweenService:Create(btn,TweenInfo.new(0.5),{Position = last, ImageTransparency = 0}):Play()
  164. last = last + UDim2.new(0,0,btn.Size.Y.Scale,btn.Size.Y.Offset + 15)
  165. wait(.1)
  166. end
  167. end
  168. elseif open then
  169. open = false
  170. for i,v in pairs(Modes) do
  171. local btn = Main:FindFirstChild(i)
  172. TweenService:Create(btn,TweenInfo.new(0.5),{Position = v.Start, ImageTransparency = 1}):Play()
  173. wait(.1)
  174. end
  175. end
  176. end)
  177.  
  178. Main.About.MouseButton1Click:Connect(function()
  179. gui.About.Position = UDim2.new(0.5, -400,1, 0)
  180. gui.About:TweenPosition(UDim2.new(0.5, -400, 0.5, -276), "Out", "Bounce", .5)
  181. Main.Visible = false
  182. end)
  183.  
  184. gui.About.CloseAbout.MouseButton1Click:Connect(function()
  185. gui.About:TweenPosition(UDim2.new(0.5, -400, 3, 0), "Out", "Bounce", .5)
  186. Main.Visible = true
  187. end)
Advertisement
Add Comment
Please, Sign In to add comment