Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.07 KB | None | 0 0
  1. --SynapseX Decompiler
  2.  
  3. repeat
  4. wait()
  5. player = game.Players.LocalPlayer
  6. until player
  7. local starterGui = game:GetService("StarterGui")
  8. local modules = script:WaitForChild("Modules")
  9. local utility = require(modules:WaitForChild("utility"))
  10. local controller = require(utility.controller)
  11. local soundscape = require(utility.soundscape)
  12. local interface = require(utility.interface)
  13. print("Loaded Modules")
  14. local inPlay = false
  15. local function getContextButton(pos)
  16. local gui = utility.playergui:FindFirstChild("ContextActionGui")
  17. if gui then
  18. local frame = gui:FindFirstChildOfClass("Frame")
  19. if frame then
  20. for i, v in pairs(frame:GetChildren()) do
  21. if v:IsA("ImageButton") and v.Position == pos then
  22. return v
  23. end
  24. end
  25. end
  26. end
  27. end
  28. local function sprintCharacter(bind, inputstate, inputobject)
  29. local s, e = pcall(function()
  30. local button = getContextButton(UDim2.new(1, -95, 1, -165))
  31. if button then
  32. button.Image = utility.asset .. "3365756619"
  33. if inputstate == Enum.UserInputState.Begin then
  34. button.ImageRectOffset = Vector2.new(146, 0)
  35. else
  36. button.ImageRectOffset = Vector2.new(0, 0)
  37. end
  38. end
  39. end)
  40. if not s then
  41. warn("Client; " .. e)
  42. end
  43. local character = player.Character
  44. if character then
  45. local humanoid = utility:humanoid()
  46. if humanoid and humanoid.Health > 0 and inPlay then
  47. local humanoidState = humanoid:GetState()
  48. if inputstate == Enum.UserInputState.Begin and (humanoidState == Enum.HumanoidStateType.Running or humanoidState == Enum.HumanoidStateType.RunningNoPhysics) then
  49. local speed = utility.Enum.WalkSpeed.Run
  50. local doubleSprint = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 6373049)
  51. if doubleSprint then
  52. speed = speed + (speed - utility.Enum.WalkSpeed.Normal)
  53. end
  54. utility:Tween(utility.camera, TweenInfo.new(0.5), {
  55. FieldOfView = utility.Enum.FieldOfView.Far
  56. })
  57. utility:Tween(humanoid, TweenInfo.new(0.5), {WalkSpeed = speed})
  58. 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
  59. utility:Tween(utility.camera, TweenInfo.new(0.2), {
  60. FieldOfView = utility.Enum.FieldOfView.Normal
  61. })
  62. utility:Tween(humanoid, TweenInfo.new(0.2), {
  63. WalkSpeed = utility.Enum.WalkSpeed.Normal
  64. })
  65. end
  66. end
  67. end
  68. end
  69. local function changePOV(bind, inputstate, inputobject)
  70. if inputstate == Enum.UserInputState.Begin then
  71. local character = player.Character
  72. if character then
  73. local humanoid, root = character:FindFirstChildOfClass("Humanoid"), character:FindFirstChild("HumanoidRootPart")
  74. if humanoid and humanoid.Health > 0 and inPlay and root then
  75. local magnitude = (game.Workspace.Camera.CFrame.p - root.Position).magnitude
  76. if magnitude <= 2.3 then
  77. player.CameraMinZoomDistance = 10
  78. player.CameraMinZoomDistance = 0.5
  79. else
  80. player.CameraMode = Enum.CameraMode.LockFirstPerson
  81. player.CameraMode = Enum.CameraMode.Classic
  82. end
  83. end
  84. end
  85. end
  86. end
  87. local completedIntroduction = false
  88. local introViewsCompleted = false
  89. utility.introduction.OnClientEvent:Connect(function(value)
  90. if value ~= nil then
  91. completedIntroduction = value
  92. end
  93. end)
  94. utility.introduction:FireServer()
  95. local function introduction(...)
  96. local introgui = utility.introgui
  97. local title, text = introgui:FindFirstChildOfClass("ImageLabel"), introgui:FindFirstChildOfClass("TextLabel")
  98. introgui.Enabled = true
  99. local info = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 2)
  100. utility:tween(title, info, {ImageTransparency = 0})
  101. utility:tween(text, info, {TextTransparency = 0})
  102. for i, v in pairs(utility.introViews:GetChildren()) do
  103. if v:IsA("BasePart") then
  104. utility.camera.CoordinateFrame = v.CFrame
  105. wait(2)
  106. end
  107. end
  108. utility:tween(title, TweenInfo.new(1), {ImageTransparency = 1})
  109. utility:tween(text, TweenInfo.new(1), {TextTransparency = 1})
  110. utility.introduction:FireServer(true)
  111. introViewsCompleted = true
  112. wait(1.2)
  113. introgui.Enabled = false
  114. end
  115. pcall(function()
  116. if utility:humanoid() then
  117. utility:humanoid().WalkSpeed = utility.Enum.WalkSpeed.None
  118. end
  119. end)
  120. utility:create(utility.camera, {
  121. CameraType = Enum.CameraType.Scriptable,
  122. FieldOfView = 30
  123. })
  124. local cameraTween
  125. ctDone = false
  126. local spawnCamera = spawn(function(...)
  127. local cameras = utility.menuViews:GetChildren()
  128. while not ctDone do
  129. for i = 1, #cameras do
  130. if not ctDone then
  131. local start, finish = cameras[i]:FindFirstChild("Start"), cameras[i]:FindFirstChild("End")
  132. if start and finish then
  133. utility.camera.CoordinateFrame = start.CFrame
  134. cameraTween = utility:Tween(utility.camera, TweenInfo.new(5), {
  135. CoordinateFrame = finish.CFrame
  136. })
  137. cameraTween.Completed:wait()
  138. end
  139. end
  140. end
  141. end
  142. end)
  143. soundscape.sounds.menu:Play()
  144. utility.audio.Volume = 0
  145. local pgui = utility.playgui
  146. local playbutton, playtitle, fade = pgui:WaitForChild("Play"), pgui:WaitForChild("Title"), pgui:WaitForChild("Fade")
  147. local clicked = false
  148. local baseSize = playtitle.Size
  149. spawn(function()
  150. local out = false
  151. while not ctDone do
  152. local inc = UDim2.new(0.025, 0, 0.025, 0)
  153. if out then
  154. inc = UDim2.new(-0.025, 0, -0.025, 0)
  155. end
  156. local tween = utility:Tween(playtitle, TweenInfo.new(3, Enum.EasingStyle.Sine), {
  157. Size = baseSize + inc
  158. })
  159. out = not out
  160. wait(2.5)
  161. end
  162. end)
  163. local locked = true
  164. local function playGame(...)
  165. if not clicked and not locked then
  166. clicked = true
  167. utility:bindAction(false, {
  168. prioritycontextactionservice = {
  169. Play = {actionFunction = playButton}
  170. }
  171. })
  172. ctDone = true
  173. local titleTween = TweenInfo.new(2, Enum.EasingStyle.Back, Enum.EasingDirection.In)
  174. utility:Tween(playtitle, titleTween, {
  175. Size = UDim2.new(0, 0, 0, 0),
  176. ImageTransparency = 1
  177. })
  178. utility:Tween(playbutton, titleTween, {
  179. Size = UDim2.new(0, 0, 0, 0),
  180. ImageTransparency = 1
  181. })
  182. utility:Tween(playbutton.Invert, TweenInfo.new(4, Enum.EasingStyle.Sine), {ImageTransparency = 1})
  183. local fadeTween = utility:Tween(fade, TweenInfo.new(2), {BackgroundTransparency = 0})
  184. utility:Tween(soundscape.sounds.menu, TweenInfo.new(2), {Volume = 0})
  185. fadeTween.Completed:wait()
  186. for i, v in pairs(pgui:GetChildren()) do
  187. if v:IsA("TextLabel") or v:IsA("ImageButton") or v:IsA("ImageLabel") then
  188. v.Visible = false
  189. end
  190. end
  191. soundscape.sounds.menu:Stop()
  192. if cameraTween ~= nil then
  193. cameraTween:Cancel()
  194. end
  195. local shownIntro = false
  196. if not completedIntroduction then
  197. spawn(introduction)
  198. wait(1)
  199. utility:Tween(utility.audio, TweenInfo.new(2), {Volume = 1})
  200. local fadeTween = utility:Tween(fade, TweenInfo.new(2), {BackgroundTransparency = 1})
  201. fadeTween.Completed:wait()
  202. repeat
  203. wait()
  204. until introViewsCompleted
  205. shownIntro = true
  206. end
  207. utility.sidebar.Enabled = true
  208. utility:create(utility.camera, {
  209. CameraSubject = utility:humanoid(),
  210. CameraType = Enum.CameraType.Custom,
  211. FieldOfView = 70
  212. })
  213. utility:humanoid().WalkSpeed = utility.Enum.WalkSpeed.Normal
  214. utility:bindAction(true, {
  215. contextactionservice = {
  216. Sprint = {
  217. actionFunction = sprintCharacter,
  218. inputs = {
  219. Enum.KeyCode.LeftShift,
  220. Enum.KeyCode.ButtonL2
  221. }
  222. }
  223. }
  224. }, false)
  225. utility.contextactionservice:SetPosition("Sprint", UDim2.new(1, -95, 1, -165))
  226. local s, e = pcall(function()
  227. local button = getContextButton(UDim2.new(1, -95, 1, -165))
  228. if button then
  229. button.Image = utility.asset .. "3365756619"
  230. button.Size = UDim2.new(0, 70, 0, 70)
  231. button.ImageRectSize = Vector2.new(146, 146)
  232. button.ImageRectOffset = Vector2.new(0, 0)
  233. end
  234. end)
  235. if not s then
  236. warn("Client; " .. e)
  237. end
  238. utility:bindAction(true, {
  239. contextactionservice = {
  240. POV = {
  241. actionFunction = changePOV,
  242. inputs = {
  243. Enum.KeyCode.V,
  244. Enum.KeyCode.ButtonL3
  245. }
  246. },
  247. Sidebar = {
  248. priority = Enum.ContextActionPriority.High,
  249. actionFunction = utility.gamepadButtons,
  250. inputs = {
  251. Enum.KeyCode.ButtonX,
  252. Enum.KeyCode.ButtonY,
  253. Enum.KeyCode.DPadDown,
  254. Enum.KeyCode.ButtonSelect,
  255. Enum.KeyCode.ButtonB,
  256. Enum.KeyCode.ButtonSelect,
  257. Enum.KeyCode.ButtonR3
  258. }
  259. }
  260. }
  261. }, true)
  262. inPlay = true
  263. if not shownIntro then
  264. utility:Tween(utility.audio, TweenInfo.new(2), {Volume = 1})
  265. local fadeTween = utility:Tween(fade, TweenInfo.new(2), {BackgroundTransparency = 1})
  266. fadeTween.Completed:wait()
  267. end
  268. wait(0.5)
  269. pgui.Enabled = false
  270. starterGui:SetCore("ResetButtonCallback", true)
  271. end
  272. end
  273. function playButton(bind, inputstate, inputobject)
  274. if not clicked and inputobject.KeyCode == Enum.KeyCode.ButtonA and not locked then
  275. if inputstate == Enum.UserInputState.Begin then
  276. utility.gamepadIconDown(playbutton, true)
  277. soundscape.sounds.harshClick:Play()
  278. elseif inputstate == Enum.UserInputState.End or inputstate == Enum.UserInputState.Cancel then
  279. utility.gamepadIconDown(playbutton, false)
  280. playGame()
  281. end
  282. end
  283. end
  284. local function playLock(lock)
  285. if not inPlay then
  286. for i, v in pairs(utility.playgui:GetDescendants()) do
  287. if v.Name == "Locked" then
  288. v.Visible = lock
  289. elseif v.Name == "Invert" then
  290. v.Visible = not lock
  291. end
  292. end
  293. pcall(function()
  294. game:GetService("UserInputService").MouseIconEnabled = not lock
  295. end)
  296. playbutton.Active = not lock
  297. locked = lock
  298. end
  299. end
  300. utility.locked.OnClientEvent:Connect(function()
  301. playLock(false)
  302. end)
  303. playbutton.MouseButton1Down:Connect(function(...)
  304. if not clicked and not locked then
  305. soundscape.sounds.harshClick:Play()
  306. playGame()
  307. end
  308. end)
  309. utility:bindAction(true, {
  310. prioritycontextactionservice = {
  311. Play = {
  312. actionFunction = playButton,
  313. inputs = {
  314. Enum.KeyCode.ButtonA
  315. },
  316. priority = 3000
  317. }
  318. }
  319. }, true)
  320. repeat
  321. wait()
  322. until not utility.player:FindFirstChild("loadScreen") or not locked
  323. playLock(false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement