Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local SGui = game:GetService("StarterGui")
- local TService = game:GetService("TweenService")
- local Main = script.Parent
- local Credits = Main.Credits
- local Settings = Main.Settings
- local Play = Main.Play
- local CamPart = workspace:WaitForChild("CamPart")
- local Camera = workspace.CurrentCamera
- Camera.CameraType = Enum.CameraType.Scriptable
- Camera.CFrame = CamPart.CFrame
- function PlaySfx(sfx)
- local new = sfx:Clone()
- new.Parent = game:GetService("SoundService")
- new:Destroy()
- end
- function UnderlineHover(obj, callback)
- local underline = obj:FindFirstChild("Underline")
- if not underline then return end
- local icon = obj:FindFirstChild("Icon")
- if not icon then return end
- local enter = TService:Create(underline, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), { BackgroundTransparency = 0 })
- local leave = TService:Create(underline, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), { BackgroundTransparency = 1 })
- local enter_text = TService:Create(obj, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), { TextColor3 = Color3.fromRGB(252, 255, 56) })
- local leave_text = TService:Create(obj, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), { TextColor3 = Color3.new(1, 1, 1) })
- local enter_underline = TService:Create(underline, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), { BackgroundColor3 = Color3.fromRGB(252, 255, 56) })
- local leave_underline = TService:Create(underline, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), { BackgroundColor3 = Color3.new(1, 1, 1) })
- local enter_icon = TService:Create(icon, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), { ImageColor3 = Color3.fromRGB(252, 255, 56) })
- local leave_icon = TService:Create(icon, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), { ImageColor3 = Color3.new(1, 1, 1) })
- local function me()
- enter:Play()
- enter_text:Play()
- enter_underline:Play()
- enter_icon:Play()
- PlaySfx(script.hover)
- end
- local function ml()
- leave:Play()
- leave_text:Play()
- leave_underline:Play()
- leave_icon:Play()
- PlaySfx(script.unhover)
- end
- local function realCallback()
- callback()
- PlaySfx(script.click)
- end
- obj.MouseEnter:Connect(me)
- obj.MouseLeave:Connect(ml)
- icon.MouseEnter:Connect(me)
- icon.MouseLeave:Connect(ml)
- obj.MouseButton1Down:Connect(realCallback)
- icon.MouseButton1Down:Connect(realCallback)
- end
- local _cam = workspace.CurrentCamera
- _cam.CameraType = Enum.CameraType.Scriptable
- local mouse = game.Players.LocalPlayer:GetMouse()
- local sensitivity = 0.03
- local lastMousePosition = mouse.X
- local Connection = mouse.Move:Connect(function()
- local delta = (mouse.X - lastMousePosition) * sensitivity
- _cam.CFrame = _cam.CFrame * CFrame.Angles(0, math.rad(delta), 0):Inverse()
- lastMousePosition = mouse.X
- end)
- SGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
- UnderlineHover(Credits, function()end)
- UnderlineHover(Settings, function()end)
- UnderlineHover(Play, function()
- Connection:Disconnect()
- script.Parent.Parent.Parent.Enabled = false
- script.Parent.Parent.Parent.Parent.UI.Enabled = true
- Camera.CameraType = Enum.CameraType.Follow
- SGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement