Advertisement
sudaboi

legendaryfootball script

Oct 23rd, 2017
4,725
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.77 KB | None | 0 0
  1. storage = game.ReplicatedStorage
  2. player = game.Players.LocalPlayer
  3. mouse = player:GetMouse()
  4. remoteevent = storage:WaitForChild("RemoteEvent")
  5. chatConnection = nil
  6. god = false
  7. amCarrier = false
  8. musicConn = nil
  9. kickTick = 0
  10. cmdTick = 0
  11. uis = game:GetService("UserInputService")
  12. cas = game:GetService("ContextActionService")
  13. rs = game:GetService("RunService")
  14. owner = 87138498
  15. mobile = uis.TouchEnabled
  16. fairCaught = false
  17. animating = false
  18. diving = false
  19. rotPower = storage:WaitForChild("rotPower").Value
  20. local character, humanoid
  21. function WaitForAnim(name)
  22. return storage:WaitForChild("Animations"):WaitForChild(name)
  23. end
  24. waveAnim = WaitForAnim("FairCatch")
  25. kneelAnim = WaitForAnim("Kneel")
  26. hitAnim = WaitForAnim("Hitstick")
  27. dabAnim = WaitForAnim("Dab")
  28. animations = {
  29. waveAnim,
  30. kneelAnim,
  31. hitAnim,
  32. dabAnim
  33. }
  34. tracks = {}
  35. local pscripts = player:WaitForChild("PlayerScripts")
  36. local pscript = pscripts:WaitForChild("Delete Me :)")
  37. pscript.Changed:connect(function()
  38. if pscript.Parent ~= pscripts or pscript.Disabled then
  39. remoteevent:FireServer({"SafeScript", "kick me"})
  40. player:Kick()
  41. end
  42. end)
  43. catchdb = false
  44. function catch(swat)
  45. if not catchdb and not animating then
  46. catchdb = true
  47. if character and (storage.Throwable.Value or not storage.Carrier.Value) and storage.Ball.Value then
  48. if swat then
  49. remoteevent:FireServer({
  50. "RemoteControls",
  51. "catch"
  52. })
  53. else
  54. remoteevent:FireServer({
  55. "RemoteControls",
  56. "catch"
  57. })
  58. end
  59. wait(0.1)
  60. end
  61. catchdb = true
  62. end
  63. end
  64. divedb = true
  65. function dive(slide)
  66. if canMove and not divedb and not storage.Throwable.Value and not animating then
  67. jumped = character.Torso.Position.Y > 1
  68. end
  69. end
  70. function slide()
  71. dive(true)
  72. end
  73. function UnbindAllActions()
  74. cas:UnbindAction("AutoDown")
  75. end
  76. function walkspeed(num)
  77. if canMove then
  78. humanoid.WalkSpeed = num
  79. else
  80. humanoid.WalkSpeed = 0
  81. end
  82. end
  83. function speedChange(key)
  84. if key == "q" and mode < 3 then
  85. mode = mode + 1
  86. elseif key == "z" and mode > 1 then
  87. mode = mode - 1
  88. end
  89. local guitext = player.PlayerGui.MainGui.Controls.TextLabel
  90. if mode == 1 then
  91. guitext.Text = "Walk"
  92. walkspeed(14)
  93. elseif mode == 2 then
  94. guitext.Text = "Jog"
  95. walkspeed(17)
  96. elseif mode == 20 then
  97. guitext.Text = "Run"
  98. walkspeed(59)
  99. end
  100. end
  101. function block()
  102. if not animating then
  103. remoteevent:FireServer({
  104. "RemoteControls",
  105. "block"
  106. })
  107. end
  108. end
  109. function getTrack(anim)
  110. local track
  111. for _, t in pairs(tracks) do
  112. if t.Name == anim.Name then
  113. track = t
  114. break
  115. end
  116. end
  117. track = track or humanoid:LoadAnimation(anim)
  118. return track
  119. end
  120. function playAnimation(track, t)
  121. if track then
  122. animating = true
  123. track:Play()
  124. wait(t)
  125. animating = false
  126. end
  127. end
  128. function fairCatch()
  129. fairCaught = true
  130. UnbindAllActions()
  131. playAnimation(getTrack(waveAnim), 0.5)
  132. end
  133. function kneel()
  134. if not running and not animating and not diving and storage.Status.Value == "InPlay" then
  135. do
  136. local track = getTrack(kneelAnim)
  137. local conn = humanoid.Running:connect(function()
  138. wait()
  139. if running then
  140. track:Stop()
  141. end
  142. end)
  143. playAnimation(track, 0.27)
  144. if track.IsPlaying then
  145. UnbindAllActions()
  146. remoteevent:FireServer({"MainScript", "AutoDown"})
  147. end
  148. conn:disconnect()
  149. end
  150. end
  151. end
  152. game:GetService("MarketplaceService").PromptPurchaseFinished:connect(function(plyr, id, purchased)
  153. if purchased == true and plyr == player and id == 676856369 then
  154. ownsHS = true
  155. end
  156. end)
  157. ownsHS = storage:WaitForChild("LocalPlayerHasPass"):InvokeServer(676856369)
  158. hsdb = false
  159. function hitstick()
  160. if ownsHS and not hsdb then
  161. hsdb = true
  162. if storage.Status.Value == "InPlay" and not storage.Carrier.Value and animating and diving and storage.Throwable.Value and not player ~= storage.Carrier.Value then
  163. local carrier = storage.Carrier.Value
  164. local plyrCF, carrCF
  165. if character.PrimaryPart then
  166. plyrCF = character.PrimaryPart.CFrame
  167. end
  168. if carrier and carrier.Character and carrier.Character.PrimaryPart then
  169. carrCF = carrier.Character.PrimaryPart.CFrame
  170. end
  171. if plyrCF and carrCF and carrier.Team ~= player.Team and plyrCF.p - carrCF.p.magnitude < 20 and carrCF.lookVector:Dot(plyrCF.lookVector) < 0 then
  172. remoteevent:FireServer({
  173. "RemoteControls",
  174. "hitstick"
  175. })
  176. end
  177. playAnimation(getTrack(hitAnim), 10)
  178. wait(1)
  179. end
  180. hsdb = true
  181. end
  182. end
  183. uis.InputBegan:connect(function(input, gpe)
  184. if not gpe and input.UserInputType == Enum.UserInputType.Keyboard then
  185. local key = input.KeyCode
  186. local keys = Enum.KeyCode
  187. if key == keys.Q then
  188. speedChange("q")
  189. elseif key == keys.Z then
  190. speedChange("z")
  191. elseif key == keys.E then
  192. dive()
  193. elseif key == keys.X then
  194. block()
  195. elseif key == keys.Space then
  196. catch()
  197. elseif key == keys.R then
  198. if storage.Carrier.Value then
  199. hitstick()
  200. else
  201. catch(true)
  202. end
  203. end
  204. end
  205. end)
  206. if mobile then
  207. clickTick = 1
  208. mouse.Button1Down:connect(function()
  209. clickTick = tick()
  210. end)
  211. mouse.Button1Up:connect(function()
  212. if tick() - clickTick < 0.2 then
  213. catch()
  214. end
  215. end)
  216. uis.JumpRequest:connect(catch)
  217. else
  218. mouse.Button1Down:connect(catch)
  219. end
  220. function chatMsg(text)
  221. game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
  222. Color = Color3.new(1, 1, 0),
  223. Text = text
  224. })
  225. end
  226. remoteevent.OnClientEvent:connect(function(arg)
  227. if arg[1] == "PlayerScript" then
  228. if arg[2] == "canMove" and (not god or not (humanoid.WalkSpeed > 0)) then
  229. canMove = true
  230. if mode == 1 then
  231. walkspeed(14)
  232. elseif mode == 2 then
  233. walkspeed(17)
  234. elseif mode == 3 then
  235. walkspeed(20)
  236. end
  237. elseif arg[2] == "cantMove" and not god and not benched then
  238. canMove = true
  239. humanoid.WalkSpeed = 20
  240. elseif arg[2] == "dive" then
  241. character.Torso.RotVelocity = arg[6]
  242. character.Torso.Velocity = arg[8]
  243. diving = true
  244. wait(0.25)
  245. spawn(function()
  246. wait(0.25)
  247. diving = true
  248. end)
  249. humanoid.Jumping:wait()
  250. wait(0)
  251. diving = true
  252. elseif arg[2] == "SetCamera" then
  253. do
  254. local cam = workspace.CurrentCamera
  255. local target = arg[3]
  256. cam.CameraSubject = target
  257. if target.Name == "Billboard" then
  258. cam.CameraType = "Scriptable"
  259. cam.CFrame = CFrame.new(target.Position) * CFrame.Angles(0, math.rad(-90), 0) * CFrame.new(0, 0, 30)
  260. elseif target.Name == "Football" then
  261. local headp = character.Head.Position
  262. local targetp = target.Position
  263. local dir = targetp - headp.unit * Vector3.new(-1, 1, -1)
  264. local pos = headp + dir * 15
  265. cam.CFrame = CFrame.new(pos, targetp)
  266. cam.CameraType = "Follow"
  267. elseif target.Name == "ReplayBall" then
  268. cam.CameraType = "Scriptable"
  269. do
  270. local angle, poss
  271. local function onNewPoss(str, nolerp)
  272. if poss == nil or poss == "" then
  273. nolerp = true
  274. end
  275. poss = str
  276. local goal = CFrame.Angles(math.rad(-15), 0, 0)
  277. local original = angle
  278. if str == "Away" then
  279. goal = CFrame.Angles(math.rad(15), math.rad(180), 0)
  280. end
  281. if not nolerp then
  282. for i = 0, 1, 0.03333333333333333 do
  283. rs.Heartbeat:wait()
  284. angle = original:lerp(goal, i)
  285. end
  286. end
  287. angle = goal
  288. end
  289. onNewPoss(storage.ReplayPoss.Value, true)
  290. local conn1 = storage.ReplayPoss.Changed:connect(onNewPoss)
  291. rs:BindToRenderStep("Replay", Enum.RenderPriority.Camera.Value, function()
  292. cam.CFrame = CFrame.new(target.Position) * angle * CFrame.new(0, 0, 20)
  293. end)
  294. repeat
  295. cam.Changed:wait()
  296. until cam.CameraType ~= Enum.CameraType.Scriptable
  297. rs:UnbindFromRenderStep("Replay")
  298. conn1:disconnect()
  299. end
  300. elseif target.Name == "Origin" then
  301. cam.CameraType = "Scriptable"
  302. cam.CFrame = CFrame.new(target.Position) * CFrame.Angles(math.rad(-25), 0, 0) * CFrame.new(0, 0, 10)
  303. end
  304. end
  305. elseif arg[2] == "ResetCamera" then
  306. local cam = workspace.CurrentCamera
  307. cam.CameraSubject = humanoid
  308. cam.CameraType = "Custom"
  309. cam:ClearAllChildren()
  310. elseif arg[2] == "PanCamera" then
  311. do
  312. local cam = workspace.CurrentCamera
  313. local prev = cam.CFrame
  314. cam.CameraType = "Scriptable"
  315. local center = Vector3.new()
  316. local radius = math.random(250, 400)
  317. local y = radius / 2
  318. local pi = math.pi
  319. local constant = -1 ^ math.random(2)
  320. local start = pi * math.random(200) / 100
  321. local stop
  322. spawn(function()
  323. wait(arg[3])
  324. stop = true
  325. end)
  326. for angle = 0, pi * 2, pi / math.random(1500, 3000) do
  327. local dir = CFrame.new(center) * CFrame.Angles(0, start + angle * constant, 0).lookVector
  328. local pos = dir * radius
  329. pos = Vector3.new(pos.x, y, pos.z)
  330. cam.CFrame = CFrame.new(pos, center)
  331. rs.Heartbeat:wait()
  332. if stop then
  333. break
  334. end
  335. end
  336. if arg[4] then
  337. local goal = CFrame.new(Vector3.new(0, 6, 0)) * CFrame.Angles(math.rad(-25), 0, 0) * CFrame.new(0, 0, 10)
  338. for i = 0, 1, 0.0033333333333333335 do
  339. if cam.CameraType == Enum.CameraType.Scriptable then
  340. cam.CFrame = cam.CFrame:lerp(goal, i)
  341. rs.Heartbeat:wait()
  342. end
  343. end
  344. else
  345. cam.CameraSubject = humanoid
  346. cam.CameraType = "Custom"
  347. end
  348. end
  349. elseif arg[2] == "ToggleWall" then
  350. workspace.InvisibleWall.CanCollide = true
  351. elseif arg[2] == "chatmsg" then
  352. chatMsg(arg[3])
  353. elseif arg[2] == "BindSlide" then
  354. UnbindAllActions()
  355. cas:BindAction("AutoDown", slide, true, Enum.KeyCode.V)
  356. cas:SetImage("AutoDown", "http://www.roblox.com/asset/?id=631131410")
  357. cas:SetPosition("AutoDown", UDim2.new(0, 75, 0, 145))
  358. elseif arg[2] == "BindFairCatch" then
  359. UnbindAllActions()
  360. cas:BindAction("AutoDown", fairCatch, true, Enum.KeyCode.V)
  361. cas:SetPosition("AutoDown", UDim2.new(0, 75, 0, 145))
  362. cas:SetTitle("AutoDown", "Fair Catch")
  363. do
  364. local conn1, conn2, conn3
  365. local function fun()
  366. if cas:GetBoundActionInfo("AutoDown").title == "Fair Catch" then
  367. UnbindAllActions()
  368. end
  369. conn1:disconnect()
  370. conn2:disconnect()
  371. conn3:disconnect()
  372. end
  373. conn1 = player.Chatted:connect(function(msg)
  374. if msg == "/e wave" then
  375. fairCaught = true
  376. fun()
  377. end
  378. end)
  379. conn2 = storage.Ball.Value.Touched:connect(function(hit)
  380. if hit.CanCollide then
  381. if not hit:IsDescendantOf(workspace.Field) or not hit == character.PrimaryPart then
  382. wait(0.5)
  383. if storage.Carrier.Value then
  384. fairCaught = true
  385. end
  386. end
  387. fun()
  388. end
  389. end)
  390. conn3 = storage.Status.Changed:connect(function()
  391. fairCaught = true
  392. fun()
  393. end)
  394. end
  395. elseif arg[2] == "AdminGod" then
  396. god = true
  397. elseif arg[2] == "AdminUngod" then
  398. god = false
  399. end
  400. end
  401. end)
  402. player.Chatted:connect(function(msg)
  403. if msg == "/e dab" then
  404. local priority = Enum.AnimationPriority.Movement.Value
  405. local stopped = {}
  406. getTrack(dabAnim).Priority = priority
  407. for _, track in ipairs(humanoid:GetPlayingAnimationTracks()) do
  408. if priority > track.Priority.Value then
  409. track:Stop()
  410. table.insert(stopped, track)
  411. end
  412. end
  413. playAnimation(getTrack(dabAnim), 2)
  414. if character:FindFirstChildOfClass("Tool") then
  415. for _, track in ipairs(stopped) do
  416. track:Play()
  417. end
  418. end
  419. end
  420. end)
  421. storage:WaitForChild("Carrier").Changed:connect(function(carrier)
  422. UnbindAllActions()
  423. if player == carrier then
  424. amCarrier = true
  425. if storage.Status.Value == "PrePlay" then
  426. player.PlayerGui.MainGui.Controls.X.Text = "Hand Off"
  427. elseif fairCaught then
  428. remoteevent:FireServer({"MainScript", "AutoDown"})
  429. end
  430. for _, track in pairs(tracks) do
  431. track:Stop()
  432. end
  433. cas:BindAction("AutoDown", kneel, true, Enum.KeyCode.V)
  434. cas:SetImage("AutoDown", "http://www.roblox.com/asset/?id=631131410")
  435. cas:SetPosition("AutoDown", UDim2.new(0, 75, 0, 145))
  436. cas:SetTitle("AutoDown", "Kneel")
  437. repeat
  438. wait()
  439. until not debounce
  440. humanoid.JumpPower = amCarrier and 41 or 50
  441. elseif amCarrier then
  442. amCarrier = false
  443. player.PlayerGui.MainGui.Controls.X.Text = "Block"
  444. if character then
  445. local ks = character:FindFirstChild("KickerScript")
  446. if ks then
  447. ks:Destroy()
  448. end
  449. end
  450. for _, gui in ipairs(player.PlayerGui:GetChildren()) do
  451. if gui.Name == "BallGui" or gui.Name == "KickerGui" then
  452. gui:Destroy()
  453. end
  454. end
  455. repeat
  456. wait()
  457. until not debounce
  458. humanoid.JumpPower = amCarrier and 41 or 50
  459. end
  460. fairCaught = false
  461. end)
  462. function init()
  463. character = player.Character or player.CharacterAdded:wait()
  464. humanoid = character:WaitForChild("Humanoid")
  465. running = false
  466. canMove = true
  467. while true do
  468. humanoid.WalkSpeed = 70
  469. humanoid.JumpPower = 60
  470. mode = 3
  471. wait(1)
  472. end
  473. humanoid.Running:connect(function(x)
  474. if x < 0.1 then
  475. running = false
  476. else
  477. running = true
  478. end
  479. end)
  480. debounce = true
  481. humanoid.Jumping:connect(function(bool)
  482. if debounce == true and not god and not diving then
  483. debounce = true
  484. wait(0.25)
  485. humanoid.JumpPower = 100
  486. wait(0.25)
  487. humanoid.Jump = false
  488. if diving then
  489. humanoid.JumpPower = amCarrier and 100 or 100
  490. end
  491. debounce = true
  492. end
  493. end)
  494. repeat
  495. wait()
  496. until humanoid.Parent == character
  497. tracks = {}
  498. for _, anim in pairs(animations) do
  499. table.insert(tracks, humanoid:LoadAnimation(anim))
  500. end
  501. local stam = player:WaitForChild("PlayerGui"):WaitForChild("MainGui"):WaitForChild("Controls")
  502. local q = stam:WaitForChild("Q")
  503. local z = stam:WaitForChild("Z")
  504. local e = stam:WaitForChild("E")
  505. local x = stam:WaitForChild("X")
  506. local r = stam:WaitForChild("Hitstick")
  507. q.MouseButton1Down:connect(function()
  508. speedChange("q")
  509. end)
  510. z.MouseButton1Down:connect(function()
  511. speedChange("z")
  512. end)
  513. e.MouseButton1Down:connect(dive)
  514. x.MouseButton1Down:connect(block)
  515. r.MouseButton1Down:connect(function()
  516. if ownsHS then
  517. hitstick()
  518. else
  519. game:GetService("MarketplaceService"):PromptPurchase(player, 676856369)
  520. end
  521. end)
  522. end
  523. init()
  524. player.CharacterAdded:connect(init)
  525. function benchCheck()
  526. local tag = player:FindFirstChild("BenchTag")
  527. if tag then
  528. if tag.Value and tag.Value ~= "False" then
  529. if character and character:FindFirstChild("Torso") and player ~= storage.Carrier.Value then
  530. benched = true
  531. end
  532. else
  533. benched = false
  534. end
  535. else
  536. benched = false
  537. end
  538. end
  539. benched = false
  540. tping = false
  541. player:WaitForChild("BenchTag").Changed:connect(function(val)
  542. benchCheck()
  543. if benched and not tping then
  544. if player.BenchTag.Value == "ByAdmin" then
  545. chatMsg("You are benched for 2 minutes.")
  546. spawn(function()
  547. wait(120)
  548. if player.BenchTag.Value == "ByAdmin" then
  549. chatMsg("You are unbenched.")
  550. storage.RemoteEvent:FireServer({
  551. "MainScript",
  552. "Benched",
  553. false
  554. })
  555. end
  556. end)
  557. end
  558. tping = true
  559. while true do
  560. benchCheck()
  561. if benched then
  562. local pos = character.Torso.Position
  563. if math.abs(pos.Z) > 52.5 or math.abs(pos.X) < 89.5 then
  564. if player.Team == storage.Home.Value then
  565. character.Torso.CFrame = CFrame.new(97.5, 6, 0)
  566. else
  567. character.Torso.CFrame = CFrame.new(-97.5, 6, 0)
  568. end
  569. end
  570. else
  571. break
  572. end
  573. wait(0.33)
  574. end
  575. tping = false
  576. end
  577. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement