Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SynapseX Decompiler
- repeat
- wait()
- player = game.Players.LocalPlayer
- until player
- local starterGui = game:GetService("StarterGui")
- local modules = script:WaitForChild("Modules")
- local utility = require(modules:WaitForChild("utility"))
- local controller = require(utility.controller)
- local soundscape = require(utility.soundscape)
- local interface = require(utility.interface)
- print("Loaded Modules")
- local inPlay = false
- local function getContextButton(pos)
- local gui = utility.playergui:FindFirstChild("ContextActionGui")
- if gui then
- local frame = gui:FindFirstChildOfClass("Frame")
- if frame then
- for i, v in pairs(frame:GetChildren()) do
- if v:IsA("ImageButton") and v.Position == pos then
- return v
- end
- end
- end
- end
- end
- local function sprintCharacter(bind, inputstate, inputobject)
- local s, e = pcall(function()
- local button = getContextButton(UDim2.new(1, -95, 1, -165))
- if button then
- button.Image = utility.asset .. "3365756619"
- if inputstate == Enum.UserInputState.Begin then
- button.ImageRectOffset = Vector2.new(146, 0)
- else
- button.ImageRectOffset = Vector2.new(0, 0)
- end
- end
- end)
- if not s then
- warn("Client; " .. e)
- end
- local character = player.Character
- if character then
- local humanoid = utility:humanoid()
- if humanoid and humanoid.Health > 0 and inPlay then
- local humanoidState = humanoid:GetState()
- if inputstate == Enum.UserInputState.Begin and (humanoidState == Enum.HumanoidStateType.Running or humanoidState == Enum.HumanoidStateType.RunningNoPhysics) then
- local speed = utility.Enum.WalkSpeed.Run
- local doubleSprint = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 6373049)
- if doubleSprint then
- speed = speed + (speed - utility.Enum.WalkSpeed.Normal)
- end
- utility:Tween(utility.camera, TweenInfo.new(0.5), {
- FieldOfView = utility.Enum.FieldOfView.Far
- })
- utility:Tween(humanoid, TweenInfo.new(0.5), {WalkSpeed = speed})
- elseif inputstate == Enum.UserInputState.End or inputstate == Enum.UserInputState.Cancel or inputstate == Enum.UserInputState.Begin and (humanoidState ~= Enum.HumanoidStateType.Running or humanoidState ~= Enum.HumanoidStateType.RunningNoPhysics) then
- utility:Tween(utility.camera, TweenInfo.new(0.2), {
- FieldOfView = utility.Enum.FieldOfView.Normal
- })
- utility:Tween(humanoid, TweenInfo.new(0.2), {
- WalkSpeed = utility.Enum.WalkSpeed.Normal
- })
- end
- end
- end
- end
- local function changePOV(bind, inputstate, inputobject)
- if inputstate == Enum.UserInputState.Begin then
- local character = player.Character
- if character then
- local humanoid, root = character:FindFirstChildOfClass("Humanoid"), character:FindFirstChild("HumanoidRootPart")
- if humanoid and humanoid.Health > 0 and inPlay and root then
- local magnitude = (game.Workspace.Camera.CFrame.p - root.Position).magnitude
- if magnitude <= 2.3 then
- player.CameraMinZoomDistance = 10
- player.CameraMinZoomDistance = 0.5
- else
- player.CameraMode = Enum.CameraMode.LockFirstPerson
- player.CameraMode = Enum.CameraMode.Classic
- end
- end
- end
- end
- end
- local completedIntroduction = false
- local introViewsCompleted = false
- utility.introduction.OnClientEvent:Connect(function(value)
- if value ~= nil then
- completedIntroduction = value
- end
- end)
- utility.introduction:FireServer()
- local function introduction(...)
- local introgui = utility.introgui
- local title, text = introgui:FindFirstChildOfClass("ImageLabel"), introgui:FindFirstChildOfClass("TextLabel")
- introgui.Enabled = true
- local info = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 2)
- utility:tween(title, info, {ImageTransparency = 0})
- utility:tween(text, info, {TextTransparency = 0})
- for i, v in pairs(utility.introViews:GetChildren()) do
- if v:IsA("BasePart") then
- utility.camera.CoordinateFrame = v.CFrame
- wait(2)
- end
- end
- utility:tween(title, TweenInfo.new(1), {ImageTransparency = 1})
- utility:tween(text, TweenInfo.new(1), {TextTransparency = 1})
- utility.introduction:FireServer(true)
- introViewsCompleted = true
- wait(1.2)
- introgui.Enabled = false
- end
- pcall(function()
- if utility:humanoid() then
- utility:humanoid().WalkSpeed = utility.Enum.WalkSpeed.None
- end
- end)
- utility:create(utility.camera, {
- CameraType = Enum.CameraType.Scriptable,
- FieldOfView = 30
- })
- local cameraTween
- ctDone = false
- local spawnCamera = spawn(function(...)
- local cameras = utility.menuViews:GetChildren()
- while not ctDone do
- for i = 1, #cameras do
- if not ctDone then
- local start, finish = cameras[i]:FindFirstChild("Start"), cameras[i]:FindFirstChild("End")
- if start and finish then
- utility.camera.CoordinateFrame = start.CFrame
- cameraTween = utility:Tween(utility.camera, TweenInfo.new(5), {
- CoordinateFrame = finish.CFrame
- })
- cameraTween.Completed:wait()
- end
- end
- end
- end
- end)
- soundscape.sounds.menu:Play()
- utility.audio.Volume = 0
- local pgui = utility.playgui
- local playbutton, playtitle, fade = pgui:WaitForChild("Play"), pgui:WaitForChild("Title"), pgui:WaitForChild("Fade")
- local clicked = false
- local baseSize = playtitle.Size
- spawn(function()
- local out = false
- while not ctDone do
- local inc = UDim2.new(0.025, 0, 0.025, 0)
- if out then
- inc = UDim2.new(-0.025, 0, -0.025, 0)
- end
- local tween = utility:Tween(playtitle, TweenInfo.new(3, Enum.EasingStyle.Sine), {
- Size = baseSize + inc
- })
- out = not out
- wait(2.5)
- end
- end)
- local locked = true
- local function playGame(...)
- if not clicked and not locked then
- clicked = true
- utility:bindAction(false, {
- prioritycontextactionservice = {
- Play = {actionFunction = playButton}
- }
- })
- ctDone = true
- local titleTween = TweenInfo.new(2, Enum.EasingStyle.Back, Enum.EasingDirection.In)
- utility:Tween(playtitle, titleTween, {
- Size = UDim2.new(0, 0, 0, 0),
- ImageTransparency = 1
- })
- utility:Tween(playbutton, titleTween, {
- Size = UDim2.new(0, 0, 0, 0),
- ImageTransparency = 1
- })
- utility:Tween(playbutton.Invert, TweenInfo.new(4, Enum.EasingStyle.Sine), {ImageTransparency = 1})
- local fadeTween = utility:Tween(fade, TweenInfo.new(2), {BackgroundTransparency = 0})
- utility:Tween(soundscape.sounds.menu, TweenInfo.new(2), {Volume = 0})
- fadeTween.Completed:wait()
- for i, v in pairs(pgui:GetChildren()) do
- if v:IsA("TextLabel") or v:IsA("ImageButton") or v:IsA("ImageLabel") then
- v.Visible = false
- end
- end
- soundscape.sounds.menu:Stop()
- if cameraTween ~= nil then
- cameraTween:Cancel()
- end
- local shownIntro = false
- if not completedIntroduction then
- spawn(introduction)
- wait(1)
- utility:Tween(utility.audio, TweenInfo.new(2), {Volume = 1})
- local fadeTween = utility:Tween(fade, TweenInfo.new(2), {BackgroundTransparency = 1})
- fadeTween.Completed:wait()
- repeat
- wait()
- until introViewsCompleted
- shownIntro = true
- end
- utility.sidebar.Enabled = true
- utility:create(utility.camera, {
- CameraSubject = utility:humanoid(),
- CameraType = Enum.CameraType.Custom,
- FieldOfView = 70
- })
- utility:humanoid().WalkSpeed = utility.Enum.WalkSpeed.Normal
- utility:bindAction(true, {
- contextactionservice = {
- Sprint = {
- actionFunction = sprintCharacter,
- inputs = {
- Enum.KeyCode.LeftShift,
- Enum.KeyCode.ButtonL2
- }
- }
- }
- }, false)
- utility.contextactionservice:SetPosition("Sprint", UDim2.new(1, -95, 1, -165))
- local s, e = pcall(function()
- local button = getContextButton(UDim2.new(1, -95, 1, -165))
- if button then
- button.Image = utility.asset .. "3365756619"
- button.Size = UDim2.new(0, 70, 0, 70)
- button.ImageRectSize = Vector2.new(146, 146)
- button.ImageRectOffset = Vector2.new(0, 0)
- end
- end)
- if not s then
- warn("Client; " .. e)
- end
- utility:bindAction(true, {
- contextactionservice = {
- POV = {
- actionFunction = changePOV,
- inputs = {
- Enum.KeyCode.V,
- Enum.KeyCode.ButtonL3
- }
- },
- Sidebar = {
- priority = Enum.ContextActionPriority.High,
- actionFunction = utility.gamepadButtons,
- inputs = {
- Enum.KeyCode.ButtonX,
- Enum.KeyCode.ButtonY,
- Enum.KeyCode.DPadDown,
- Enum.KeyCode.ButtonSelect,
- Enum.KeyCode.ButtonB,
- Enum.KeyCode.ButtonSelect,
- Enum.KeyCode.ButtonR3
- }
- }
- }
- }, true)
- inPlay = true
- if not shownIntro then
- utility:Tween(utility.audio, TweenInfo.new(2), {Volume = 1})
- local fadeTween = utility:Tween(fade, TweenInfo.new(2), {BackgroundTransparency = 1})
- fadeTween.Completed:wait()
- end
- wait(0.5)
- pgui.Enabled = false
- starterGui:SetCore("ResetButtonCallback", true)
- end
- end
- function playButton(bind, inputstate, inputobject)
- if not clicked and inputobject.KeyCode == Enum.KeyCode.ButtonA and not locked then
- if inputstate == Enum.UserInputState.Begin then
- utility.gamepadIconDown(playbutton, true)
- soundscape.sounds.harshClick:Play()
- elseif inputstate == Enum.UserInputState.End or inputstate == Enum.UserInputState.Cancel then
- utility.gamepadIconDown(playbutton, false)
- playGame()
- end
- end
- end
- local function playLock(lock)
- if not inPlay then
- for i, v in pairs(utility.playgui:GetDescendants()) do
- if v.Name == "Locked" then
- v.Visible = lock
- elseif v.Name == "Invert" then
- v.Visible = not lock
- end
- end
- pcall(function()
- game:GetService("UserInputService").MouseIconEnabled = not lock
- end)
- playbutton.Active = not lock
- locked = lock
- end
- end
- utility.locked.OnClientEvent:Connect(function()
- playLock(false)
- end)
- playbutton.MouseButton1Down:Connect(function(...)
- if not clicked and not locked then
- soundscape.sounds.harshClick:Play()
- playGame()
- end
- end)
- utility:bindAction(true, {
- prioritycontextactionservice = {
- Play = {
- actionFunction = playButton,
- inputs = {
- Enum.KeyCode.ButtonA
- },
- priority = 3000
- }
- }
- }, true)
- repeat
- wait()
- until not utility.player:FindFirstChild("loadScreen") or not locked
- playLock(false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement