Advertisement
bmrx13

slam jam

Jun 13th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. local uis = game:GetService("UserInputService")
  2. local runs = game:GetService("RunService")
  3.  
  4. local plr = game.Players.LocalPlayer
  5. local target = nil
  6. local anim = Instance.new("Animation")
  7. anim.AnimationId = "rbxassetid://126753849"
  8.  
  9. local summoned = false
  10.  
  11. local e
  12.  
  13. local prevora = tick()+1
  14.  
  15. local mode = "Idle"
  16.  
  17. local connect = {}
  18.  
  19. uis.InputBegan:Connect(function(input, istpying)
  20. if istpying then return end
  21. if input.KeyCode == Enum.KeyCode.E then
  22. mode = "Barrage"
  23. end
  24. if input.KeyCode == Enum.KeyCode.Q then
  25. summoned = not summoned
  26. end
  27. end)
  28.  
  29. uis.InputEnded:Connect(function(input, istpying)
  30. if istpying then return end
  31. if input.KeyCode == Enum.KeyCode.E then
  32. mode = "Idle"
  33. end
  34. end)
  35.  
  36. plr.Chatted:Connect(function(msg)
  37. local split = string.split(msg, ":")
  38. if split[1] == "sel" then
  39. summoned = false
  40. target = game.Players:FindFirstChild(split[2])
  41. if e then e:Disconnect() end
  42. e = target.Chatted:Connect(function(msg)
  43. if string.match(string.lower(msg), "barrage") then
  44. mode = "Barrage"
  45. delay(3, function()
  46. mode = "Idle"
  47. end)
  48. end
  49. if msg == plr.Name.."!" then
  50. summoned = not summoned
  51. end
  52. end)
  53. end
  54. end)
  55.  
  56. local cfram = CFrame.new()
  57. local function fastrun()
  58. if target ~= nil then
  59. plr.Character.Humanoid.PlatformStand = false
  60. workspace.CurrentCamera.CameraSubject = target.Character.Head
  61. if summoned == true then
  62. if mode == "Idle" then
  63. cfram = cfram:Lerp(target.Character.HumanoidRootPart.CFrame * CFrame.new(-1,1+math.sin(tick()*2),2), 0.1)
  64. else
  65. if tick() > prevora then
  66. prevora = tick()+1
  67. end
  68. cfram = cfram:Lerp(target.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-6-math.sin(tick()*40)*3) * CFrame.Angles(0,-math.rad(math.sin(tick()*40)*45),math.rad(math.cos(tick()*20)*30)), 0.1)
  69. end
  70. else
  71. cfram = cfram:Lerp(CFrame.new(0,1000,0), 0.4)
  72. end
  73. plr.Character.HumanoidRootPart.Velocity = Vector3.new()
  74. plr.Character.HumanoidRootPart.CFrame = cfram
  75. else
  76. workspace.CurrentCamera.CameraSubject = plr.Character.Head
  77. plr.Character.Humanoid.PlatformStand = false
  78. end
  79. end
  80. table.insert(connect, runs.Heartbeat:Connect(fastrun))
  81. table.insert(connect, runs.Stepped:Connect(fastrun))
  82. table.insert(connect, runs.RenderStepped:Connect(fastrun))
  83. plr.Chatted:Connect(function(msg)
  84. if msg == "stop" then for i, v in pairs(connect) do v:Disconnect() end end
  85. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement