Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables
- local player = game.Players.LocalPlayer
- local char = player.Character or player.CharacterAdded:wait()
- local mouse = player:GetMouse()
- local camera = workspace.CurrentCamera
- local RepStore = game.ReplicatedStorage
- local ContentProvider = game:GetService("ContentProvider")
- local RunService = game:GetService("RunService")
- local TweenService = game:GetService("TweenService")
- local UserInput = game:GetService("UserInputService")
- local network = {}
- local screen = {}
- local gui = script.Parent
- local Audio = gui.Audio
- local Main = gui.Main
- do -- screen
- function screen.new(color,caller)
- print("SCREEN CALLER",caller)
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(1,0,1.1,0)
- frame.Position = UDim2.new(0,0,-0.1,0)
- frame.BorderSizePixel = 0
- frame.BackgroundTransparency = 1
- frame.BackgroundColor3 = color
- frame.Parent = gui
- local Events = {
- In = function(time) TweenService:Create(frame,TweenInfo.new(time),{BackgroundTransparency = 0}):Play() end,
- Out = function(time) TweenService:Create(frame,TweenInfo.new(time),{BackgroundTransparency = 1}):Play() wait(time) frame:Destroy() end
- }
- return Events
- end
- end
- -- Loading Screen
- spawn(function()
- local Intro = gui["Loading Screen"]
- Main.Visible = false
- Intro.Black.Visible = true
- Intro.clip.Visible = true
- Intro.clip.Background_.Visible = true
- Audio.Intro:Play()
- while ContentProvider.RequestQueueSize > 0 do
- Intro.clip.Background_.Image = "rbxgameasset://Images/loading1"
- wait(0.5)
- Intro.clip.Background_.Image = "rbxgameasset://Images/loading2"
- wait(0.5)
- Intro.clip.Background_.Image = "rbxgameasset://Images/loading3"
- wait(0.5)
- end
- wait(1)
- Intro.clip.Background_:TweenPosition(UDim2.new(0.5,0,1.5,0), "Out", "Quad", .5)
- wait(.5)
- Main.Visible = true
- game.Lighting.Blur.Size = gui.Configuration.BlurSize.Value
- TweenService:Create(Intro.Black,TweenInfo.new(0.5),{ImageTransparency = 1}):Play()
- end)
- -- Initial shit
- for i,v in pairs(Main:GetChildren()) do
- if v:IsA("ImageButton") then
- v.MouseEnter:Connect(function()
- v.Size = v.Size + UDim2.new(0,10,0,10)
- v.Position = v.Position - UDim2.new(0,5,0,5)
- end)
- v.MouseLeave:Connect(function()
- v.Size = v.Size - UDim2.new(0,10,0,10)
- v.Position = v.Position + UDim2.new(0,5,0,5)
- end)
- end
- end
- -- Menu shit
- local inMenu = true
- local Run = RunService.RenderStepped:Connect(function()
- gui.Cursor.Position = UDim2.new(0,mouse.X,0,mouse.Y)
- UserInput.MouseIconEnabled = false
- end)
- spawn(function()
- while inMenu do
- local particle = Instance.new("Frame")
- particle.AnchorPoint = Vector2.new(0.5,0.5)
- particle.BackgroundColor3 = Color3.new(1,1,1)
- particle.BorderSizePixel = 0
- particle.Size = UDim2.new(0,5,0,5)
- particle.Position = UDim2.new(0,mouse.X,0,mouse.Y)
- particle.Parent = gui.Particles
- TweenService:Create(particle,TweenInfo.new(0.3),{BackgroundTransparency = 1,Rotation = math.random(-45,45)}):Play()
- game:GetService("Debris"):AddItem(particle,0.22)
- RunService.RenderStepped:wait()
- end
- end)
- local Modes = {
- ["Normal"] = {
- ImageID = "rbxgameasset://Images/gamemode_normal_2",
- Size = UDim2.new(0,500,0,60),
- Start = Main.Play.Position + UDim2.new(0,0,0,50),--UDim2.new(math.random(),0,-0.2,0),
- OnClick = function()
- Audio.Intro:Stop()
- inMenu = false
- Main.Visible = false
- repeat workspace.CurrentCamera.CameraType = Enum.CameraType.Custom wait() until workspace.CurrentCamera.CameraType == Enum.CameraType.Custom
- local Screen = screen.new(Color3.new(1,1,1),"Modes")
- Screen.In(0.5)
- wait(2)
- Screen.Out(0.5)
- end
- },
- ["User Made Levels (WIP)"] = {
- ImageID = "rbxgameasset://Images/coollogo_com-11542288",
- Size = UDim2.new(0,400,0,65),
- Start = Main.Play.Position + UDim2.new(0,0,0,50),--UDim2.new(math.random(),0,-0.2,0),
- OnClick = function()
- end
- },
- ["Race (WIP)"] = {
- ImageID = "rbxgameasset://Images/gamemode_race_1",
- Size = UDim2.new(0,500,0,65),
- Start = Main.Play.Position + UDim2.new(0,0,0,50),--UDim2.new(math.random(),0,-0.2,0),
- OnClick = function()
- end
- },
- }
- local open = false
- Main.Play.MouseButton1Click:Connect(function()
- Audio.ButtonClick:Play()
- if not open then
- open = true
- local last = Main.Play.Position + UDim2.new(0,15,Main.Play.Size.Y.Scale,Main.Play.Size.Y.Offset)
- for i,v in pairs(Modes) do
- if not Main:FindFirstChild(i) then
- local btn = Instance.new("ImageButton")
- btn.BackgroundTransparency = 1
- btn.ImageTransparency = 1
- btn.Name = i
- btn.Image = v.ImageID
- btn.Size = v.Size
- btn.Position = v.Start
- TweenService:Create(btn,TweenInfo.new(0.5),{Position = last, ImageTransparency = 0}):Play()
- last = last + UDim2.new(0,0,btn.Size.Y.Scale,btn.Size.Y.Offset + 15)
- btn.Parent = Main
- btn.MouseButton1Click:Connect(v.OnClick)
- wait(.1)
- else
- local btn = Main:FindFirstChild(i)
- TweenService:Create(btn,TweenInfo.new(0.5),{Position = last, ImageTransparency = 0}):Play()
- last = last + UDim2.new(0,0,btn.Size.Y.Scale,btn.Size.Y.Offset + 15)
- wait(.1)
- end
- end
- elseif open then
- open = false
- for i,v in pairs(Modes) do
- local btn = Main:FindFirstChild(i)
- TweenService:Create(btn,TweenInfo.new(0.5),{Position = v.Start, ImageTransparency = 1}):Play()
- wait(.1)
- end
- end
- end)
- Main.About.MouseButton1Click:Connect(function()
- gui.About.Position = UDim2.new(0.5, -400,1, 0)
- gui.About:TweenPosition(UDim2.new(0.5, -400, 0.5, -276), "Out", "Bounce", .5)
- Main.Visible = false
- end)
- gui.About.CloseAbout.MouseButton1Click:Connect(function()
- gui.About:TweenPosition(UDim2.new(0.5, -400, 3, 0), "Out", "Bounce", .5)
- Main.Visible = true
- end)
Advertisement
Add Comment
Please, Sign In to add comment