Advertisement
Guest User

2

a guest
Feb 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character
  2. local plr = game.Players.LocalPlayer
  3. repeat wait() until plr.Character
  4. local char = plr.Character
  5.  
  6.  
  7.  
  8. local UIS = game:GetService("UserInputService")
  9.  
  10. local object = workspace:FindFirstChild("object")
  11. local CD = object.ClickDetector
  12.  
  13. CD.MouseHoverEnter:Connect(function()
  14. math.randomseed(tick())
  15. local randomMag = math.random(30,100)
  16.  
  17. print(randomMag)
  18. char.HumanoidRootPart.CFrame = CFrame.new((object.Position + Vector3.new(0,0,randomMag)))
  19. print((char.HumanoidRootPart.Position-object.Position).magnitude)
  20. end)
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. local canDJ = false
  51. --local hasDJ = false
  52. local jumpCounter = 0
  53. local isDj = false
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. UIS.JumpRequest:Connect(function()
  64. local coro = coroutine.create(function()
  65.  
  66. --if char.Humanoid:GetState() == Enum.HumanoidStateType.Jumping then
  67. if jumpCounter == 0 then
  68. jumpCounter = 1
  69. --print(5)
  70.  
  71. elseif jumpCounter == 1 then
  72.  
  73. local magnitude = (char.HumanoidRootPart.Position - workspace:FindFirstChild("Baseplate").Position).magnitude
  74. if magnitude <=45 then
  75. canDJ = true
  76. if canDJ == true then
  77. --canDJ = false
  78. --print(1)
  79. char.Humanoid.JumpPower = 70
  80. wait()
  81. char.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
  82. char.Humanoid.JumpPower = 50
  83. end
  84. end
  85. end
  86. --end
  87. end)
  88. coroutine.resume(coro)
  89. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement