Open sourced vaulting system (really simply made)

Put the code in startercharacterscripts

local UIS = game:GetService("UserInputService")

local Character = script.Parent
local Root = Character:WaitForChild("HumanoidRootPart")
local Humanoid = Character:WaitForChild("Humanoid")

local Params = RaycastParams.new()
Params.RespectCanCollide = true
Params.FilterType = Enum.RaycastFilterType.Exclude
Params.FilterDescendantsInstances = {Character,  workspace.CurrentCamera}

UIS.JumpRequest:Connect(function()
    if Humanoid.FloorMaterial == Enum.Material.Air then
        return
    end
    
    local VaultCastHead = workspace:Raycast(Character.Head.CFrame.Position + Vector3.new(0,-.5,-.5),Root.CFrame.LookVector*5,Params)
    local VaultCast = workspace:Raycast(Root.CFrame.Position + Vector3.new(0,-.5,0),Root.CFrame.LookVector*3.5,Params)

    if VaultCastHead then
        return
    end

    if not VaultCast then
        Humanoid:ChangeState(Enum.HumanoidStateType.Jumping) 
        return
    end

    Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping,false)

    VaultCast.Instance.CanCollide = false

    Root.AssemblyLinearVelocity = Root.CFrame.LookVector * 90 + Vector3.new(0,5,0)
    
    task.wait(.2)
    VaultCast.Instance.CanCollide = true
end)
7 Likes

Hi, I put this where you said, and moved and jumped around but it does not seem to do anything…

I am I correct that a jump triggers it? then what is supposed to happen?

Thank

The part is prob too small try making it bigger and play around with the positions on the raycast

umm, what do you mean by a part… I did nothing with a part…what do I need to do besides put this localscript in startercharacterscripts?

You have to have a part infront of you that is almost the same height as ur waist. when jumping (u have to be close to the part) u will “climb” across the part

ok, I will try, that out… maybe a demo video or a place with EDIT , or a .rbxl would help out… I have been running and jumping all day

Vault.rbxl (48.8 KB)

1 Like

hi this is a really good script, but do u know how i would be able to make a physics - based animation play when the script is activated?