Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.51 KB | None | 0 0
  1. --[[
  2.  
  3. For better percision on the tree jumping.
  4. This can also be used for other stuff in the future
  5. --Stolid
  6. --]]
  7. wait(2)
  8. local UIS = game:GetService('UserInputService')
  9. local me = game.Players.LocalPlayer
  10. repeat wait(.1) until me.Character
  11. local anim = me.Character.Humanoid:LoadAnimation(script.Execution)
  12. local CanExecute = true
  13. local ws = 16
  14. local animing = false
  15. local function onInputBegan(input,gameProcessed)
  16. if input.KeyCode == Enum.KeyCode.Space and not gameProcessed then
  17. script.Parent:WaitForChild('NMSV2'):WaitForChild('Jump').Value = true
  18. wait(.2)
  19. script.Parent:WaitForChild('NMSV2'):WaitForChild('Jump').Value = false
  20. elseif input.KeyCode == Enum.KeyCode.E and not gameProcessed and CanExecute == true and me.Name ~= "" then
  21. -- pressed E in order to execute
  22. if me.Character:FindFirstChild('Kunai__') then
  23. CanExecute = false
  24. print('fired')
  25. local bodies = workspace.Marks:GetChildren()
  26. for i,v in pairs(bodies) do
  27. if v.ClassName == 'Model' and v.Name ~= "" and v:FindFirstChild('Torso') and v.Torso:FindFirstChild('PlayerValue') and not v:FindFirstChild('Dead') then
  28. if (me.Character.Torso.Position - v.Torso.Position).magnitude <= 5 then
  29. animing = true
  30. ws = 0
  31. me.Character.Humanoid.JumpPower = 0
  32. anim:Play(0.1,1,0.4)
  33. local tb = Instance.new("BoolValue")
  34. tb.Name = "TrueDisable"
  35. tb.Parent = me.Character
  36. local go = true
  37. local attacked = false
  38. local head = me.Character.Head
  39. local childAddedListener = head.ChildAdded:connect(function(child)
  40. if child.Name ~= 'creator' then return end
  41.  
  42. attacked = true
  43. end)
  44.  
  45. for i=1,12 do
  46. if attacked then
  47. go = false
  48. break
  49. end
  50. wait(0.1)
  51. end
  52.  
  53. childAddedListener:disconnect()
  54.  
  55. if go == true then
  56. game.ReplicatedStorage.Events.Executed:FireServer(v.Torso.PlayerValue.Value)
  57. end
  58. wait(1)
  59. tb:Destroy()
  60. animing = false
  61. ws = 16
  62. me.Character.Humanoid.JumpPower = 50
  63. end
  64. end
  65. end
  66. print('reloaded')
  67. CanExecute = true
  68. elseif me.PlayerGui:FindFirstChild("EarthGrudge") then -- kakuzu stitch!!!
  69. CanExecute = false
  70. local bodies = workspace.Marks:GetChildren()
  71. for i,v in pairs(bodies) do
  72. if v.ClassName == 'Model' and v:FindFirstChild('Torso') and v.Torso:FindFirstChild('PlayerValue') and not v:FindFirstChild('Dead') then
  73. if (me.Character.Torso.Position - v.Torso.Position).magnitude <= 5 then
  74. animing = true
  75. ws = 0
  76. me.Character.Humanoid.JumpPower = 0
  77. anim:Play(0.1,1,0.4)
  78. local tb = Instance.new("BoolValue")
  79.  
  80. tb.Name = "TrueDisable"
  81. tb.Parent = me.Character
  82. local ohealth = me.Character.Humanoid.Health
  83. local go = true
  84. for i=1,12 do
  85. if me.Character.Humanoid.Health < ohealth then
  86. go = false
  87. break
  88. end
  89. wait(0.1)
  90. end
  91. if go == true then
  92. game.ReplicatedStorage.Events.ReviveOther:FireServer(v.Torso.PlayerValue.Value,v.Torso.Position)
  93. end
  94. wait(1)
  95. tb:Destroy()
  96. animing = false
  97. ws = 16
  98. me.Character.Humanoid.JumpPower = 50
  99. end
  100. end
  101. end
  102. CanExecute = true
  103. end
  104. end
  105. end
  106.  
  107. wait()
  108.  
  109. local me = game.Players.LocalPlayer
  110. repeat wait() until me.Character
  111. local FirstJump = false
  112. local MidJump = false
  113. local Mouse = me:GetMouse()
  114. local anim = me.Character.Humanoid:LoadAnimation(script[1])
  115. local jumpcool = true
  116.  
  117. local char = me.Character
  118. local hum = me.Character:WaitForChild("Humanoid")
  119. game:GetService("RunService").RenderStepped:connect(function()
  120. if jumpcool == false or animing == true or char:findFirstChild("Stun") then
  121. hum.Jump = false
  122. else
  123. hum.JumpPower= 25 + (25 * hum.Health/hum.MaxHealth)
  124. end
  125. if char:findFirstChild("NoJump") then
  126. hum.Jump = false
  127. end
  128. if char:WaitForChild("Running").Value == false then
  129. local ows = ws
  130. for a,b in pairs(char.Effects:GetChildren()) do
  131. if b.Name == "SpeedBoost" then
  132. ows = ows + b.Value
  133. end
  134. end
  135. hum.WalkSpeed= ows
  136. else
  137. end
  138. if char:findFirstChild("TrueDisable") then
  139. hum.Jump = false
  140. hum.WalkSpeed = 0
  141. end
  142. end)
  143. local didjump= false
  144. hum.Jumping:connect(function()
  145. didjump = true
  146. FirstJump = true
  147.  
  148. --- jumpcool = false
  149. end)
  150. hum.FreeFalling:connect(function()
  151. didjump = true
  152. --jumpcool = false
  153. end)
  154.  
  155. local correcting= false
  156. hum.Running:connect(function()
  157. FirstJump = false
  158. MidJump = false
  159. if didjump then
  160. didjump = false
  161. jumpcool = false
  162. end
  163. if correcting == false then
  164. correcting = true
  165. -- print("Landed")
  166. if jumpcool == false then
  167. wait(0.5)
  168. jumpcool = true
  169. end
  170. correcting = false
  171. end
  172. end)
  173. function onKeyDown(key)
  174. if string.byte(key) == 32 and FirstJump == true and (MidJump == false or script.Creative.Value == true) then
  175. MidJump = true
  176. anim:Play()
  177. local spow = 35 + (40 * hum.Health/hum.MaxHealth)
  178. me.Character.HumanoidRootPart.Velocity = Vector3.new(0,spow,0)
  179. game.ReplicatedStorage.Events.SoundControl:FireServer('Soundz')
  180. end
  181. end
  182.  
  183. function Update()
  184. if me.Character.Humanoid.Jump == true then
  185. --FirstJump = true
  186. else
  187. -- FirstJump = false
  188. -- MidJump = false
  189. end
  190. end
  191.  
  192. UIS.InputBegan:connect(onInputBegan)
  193. Mouse.KeyDown:connect(onKeyDown)
  194. me.Character.Humanoid.Changed:connect(Update)
  195.  
  196. script.Interact.OnClientEvent:connect(function(x)
  197. if x then
  198. me.PlayerGui.Headband.ChoiceFrame.Visible = true
  199. end
  200. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement