Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- For better percision on the tree jumping.
- This can also be used for other stuff in the future
- --Stolid
- --]]
- wait(2)
- local UIS = game:GetService('UserInputService')
- local me = game.Players.LocalPlayer
- repeat wait(.1) until me.Character
- local anim = me.Character.Humanoid:LoadAnimation(script.Execution)
- local CanExecute = true
- local ws = 16
- local animing = false
- local function onInputBegan(input,gameProcessed)
- if input.KeyCode == Enum.KeyCode.Space and not gameProcessed then
- script.Parent:WaitForChild('NMSV2'):WaitForChild('Jump').Value = true
- wait(.2)
- script.Parent:WaitForChild('NMSV2'):WaitForChild('Jump').Value = false
- elseif input.KeyCode == Enum.KeyCode.E and not gameProcessed and CanExecute == true and me.Name ~= "" then
- -- pressed E in order to execute
- if me.Character:FindFirstChild('Kunai__') then
- CanExecute = false
- print('fired')
- local bodies = workspace.Marks:GetChildren()
- for i,v in pairs(bodies) do
- if v.ClassName == 'Model' and v.Name ~= "" and v:FindFirstChild('Torso') and v.Torso:FindFirstChild('PlayerValue') and not v:FindFirstChild('Dead') then
- if (me.Character.Torso.Position - v.Torso.Position).magnitude <= 5 then
- animing = true
- ws = 0
- me.Character.Humanoid.JumpPower = 0
- anim:Play(0.1,1,0.4)
- local tb = Instance.new("BoolValue")
- tb.Name = "TrueDisable"
- tb.Parent = me.Character
- local go = true
- local attacked = false
- local head = me.Character.Head
- local childAddedListener = head.ChildAdded:connect(function(child)
- if child.Name ~= 'creator' then return end
- attacked = true
- end)
- for i=1,12 do
- if attacked then
- go = false
- break
- end
- wait(0.1)
- end
- childAddedListener:disconnect()
- if go == true then
- game.ReplicatedStorage.Events.Executed:FireServer(v.Torso.PlayerValue.Value)
- end
- wait(1)
- tb:Destroy()
- animing = false
- ws = 16
- me.Character.Humanoid.JumpPower = 50
- end
- end
- end
- print('reloaded')
- CanExecute = true
- elseif me.PlayerGui:FindFirstChild("EarthGrudge") then -- kakuzu stitch!!!
- CanExecute = false
- local bodies = workspace.Marks:GetChildren()
- for i,v in pairs(bodies) do
- if v.ClassName == 'Model' and v:FindFirstChild('Torso') and v.Torso:FindFirstChild('PlayerValue') and not v:FindFirstChild('Dead') then
- if (me.Character.Torso.Position - v.Torso.Position).magnitude <= 5 then
- animing = true
- ws = 0
- me.Character.Humanoid.JumpPower = 0
- anim:Play(0.1,1,0.4)
- local tb = Instance.new("BoolValue")
- tb.Name = "TrueDisable"
- tb.Parent = me.Character
- local ohealth = me.Character.Humanoid.Health
- local go = true
- for i=1,12 do
- if me.Character.Humanoid.Health < ohealth then
- go = false
- break
- end
- wait(0.1)
- end
- if go == true then
- game.ReplicatedStorage.Events.ReviveOther:FireServer(v.Torso.PlayerValue.Value,v.Torso.Position)
- end
- wait(1)
- tb:Destroy()
- animing = false
- ws = 16
- me.Character.Humanoid.JumpPower = 50
- end
- end
- end
- CanExecute = true
- end
- end
- end
- wait()
- local me = game.Players.LocalPlayer
- repeat wait() until me.Character
- local FirstJump = false
- local MidJump = false
- local Mouse = me:GetMouse()
- local anim = me.Character.Humanoid:LoadAnimation(script[1])
- local jumpcool = true
- local char = me.Character
- local hum = me.Character:WaitForChild("Humanoid")
- game:GetService("RunService").RenderStepped:connect(function()
- if jumpcool == false or animing == true or char:findFirstChild("Stun") then
- hum.Jump = false
- else
- hum.JumpPower= 25 + (25 * hum.Health/hum.MaxHealth)
- end
- if char:findFirstChild("NoJump") then
- hum.Jump = false
- end
- if char:WaitForChild("Running").Value == false then
- local ows = ws
- for a,b in pairs(char.Effects:GetChildren()) do
- if b.Name == "SpeedBoost" then
- ows = ows + b.Value
- end
- end
- hum.WalkSpeed= ows
- else
- end
- if char:findFirstChild("TrueDisable") then
- hum.Jump = false
- hum.WalkSpeed = 0
- end
- end)
- local didjump= false
- hum.Jumping:connect(function()
- didjump = true
- FirstJump = true
- --- jumpcool = false
- end)
- hum.FreeFalling:connect(function()
- didjump = true
- --jumpcool = false
- end)
- local correcting= false
- hum.Running:connect(function()
- FirstJump = false
- MidJump = false
- if didjump then
- didjump = false
- jumpcool = false
- end
- if correcting == false then
- correcting = true
- -- print("Landed")
- if jumpcool == false then
- wait(0.5)
- jumpcool = true
- end
- correcting = false
- end
- end)
- function onKeyDown(key)
- if string.byte(key) == 32 and FirstJump == true and (MidJump == false or script.Creative.Value == true) then
- MidJump = true
- anim:Play()
- local spow = 35 + (40 * hum.Health/hum.MaxHealth)
- me.Character.HumanoidRootPart.Velocity = Vector3.new(0,spow,0)
- game.ReplicatedStorage.Events.SoundControl:FireServer('Soundz')
- end
- end
- function Update()
- if me.Character.Humanoid.Jump == true then
- --FirstJump = true
- else
- -- FirstJump = false
- -- MidJump = false
- end
- end
- UIS.InputBegan:connect(onInputBegan)
- Mouse.KeyDown:connect(onKeyDown)
- me.Character.Humanoid.Changed:connect(Update)
- script.Interact.OnClientEvent:connect(function(x)
- if x then
- me.PlayerGui.Headband.ChoiceFrame.Visible = true
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement