SHOW:
|
|
- or go back to the newest paste.
| 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 | Run:Disconnect() | |
| 110 | UserInput.MouseIconEnabled = true | |
| 111 | Audio.Intro:Stop() | |
| 112 | inMenu = false | |
| 113 | Main.Visible = false | |
| 114 | repeat workspace.CurrentCamera.CameraType = Enum.CameraType.Custom wait() until workspace.CurrentCamera.CameraType == Enum.CameraType.Custom | |
| 115 | local Screen = screen.new(Color3.new(1,1,1),"Modes") | |
| 116 | Screen.In(0.5) | |
| 117 | wait(2) | |
| 118 | Screen.Out(0.5) | |
| 119 | end | |
| 120 | }, | |
| 121 | ["User Made Levels (WIP)"] = {
| |
| 122 | ImageID = "rbxgameasset://Images/coollogo_com-11542288", | |
| 123 | Size = UDim2.new(0,400,0,65), | |
| 124 | Start = Main.Play.Position + UDim2.new(0,0,0,50),--UDim2.new(math.random(),0,-0.2,0), | |
| 125 | OnClick = function() | |
| 126 | ||
| 127 | end | |
| 128 | }, | |
| 129 | ["Race (WIP)"] = {
| |
| 130 | ImageID = "rbxgameasset://Images/gamemode_race_1", | |
| 131 | Size = UDim2.new(0,500,0,65), | |
| 132 | Start = Main.Play.Position + UDim2.new(0,0,0,50),--UDim2.new(math.random(),0,-0.2,0), | |
| 133 | OnClick = function() | |
| 134 | ||
| 135 | end | |
| 136 | }, | |
| 137 | } | |
| 138 | ||
| 139 | local open = false | |
| 140 | Main.Play.MouseButton1Click:Connect(function() | |
| 141 | Audio.ButtonClick:Play() | |
| 142 | ||
| 143 | if not open then | |
| 144 | open = true | |
| 145 | local last = Main.Play.Position + UDim2.new(0,15,Main.Play.Size.Y.Scale,Main.Play.Size.Y.Offset) | |
| 146 | ||
| 147 | for i,v in pairs(Modes) do | |
| 148 | if not Main:FindFirstChild(i) then | |
| 149 | local btn = Instance.new("ImageButton")
| |
| 150 | btn.BackgroundTransparency = 1 | |
| 151 | btn.ImageTransparency = 1 | |
| 152 | btn.Name = i | |
| 153 | ||
| 154 | btn.Image = v.ImageID | |
| 155 | btn.Size = v.Size | |
| 156 | btn.Position = v.Start | |
| 157 | TweenService:Create(btn,TweenInfo.new(0.5),{Position = last, ImageTransparency = 0}):Play()
| |
| 158 | last = last + UDim2.new(0,0,btn.Size.Y.Scale,btn.Size.Y.Offset + 15) | |
| 159 | btn.Parent = Main | |
| 160 | ||
| 161 | btn.MouseButton1Click:Connect(v.OnClick) | |
| 162 | wait(.1) | |
| 163 | else | |
| 164 | local btn = Main:FindFirstChild(i) | |
| 165 | TweenService:Create(btn,TweenInfo.new(0.5),{Position = last, ImageTransparency = 0}):Play()
| |
| 166 | last = last + UDim2.new(0,0,btn.Size.Y.Scale,btn.Size.Y.Offset + 15) | |
| 167 | wait(.1) | |
| 168 | end | |
| 169 | end | |
| 170 | elseif open then | |
| 171 | open = false | |
| 172 | for i,v in pairs(Modes) do | |
| 173 | local btn = Main:FindFirstChild(i) | |
| 174 | TweenService:Create(btn,TweenInfo.new(0.5),{Position = v.Start, ImageTransparency = 1}):Play()
| |
| 175 | wait(.1) | |
| 176 | end | |
| 177 | end | |
| 178 | end) | |
| 179 | ||
| 180 | Main.About.MouseButton1Click:Connect(function() | |
| 181 | gui.About.Position = UDim2.new(0.5, -400,1, 0) | |
| 182 | gui.About:TweenPosition(UDim2.new(0.5, -400, 0.5, -276), "Out", "Bounce", .5) | |
| 183 | Main.Visible = false | |
| 184 | end) | |
| 185 | ||
| 186 | gui.About.CloseAbout.MouseButton1Click:Connect(function() | |
| 187 | gui.About:TweenPosition(UDim2.new(0.5, -400, 3, 0), "Out", "Bounce", .5) | |
| 188 | Main.Visible = true | |
| 189 | end) |