Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---some local script function on pastebin because my PC is unavailable. It might not work, I haven't tested (wonder why)
- ----Services
- local TweenService = game:GetService("TweenService")
- local InputService = game:GetService("UserInputService")
- ----Debounces
- local VaultDB = false
- ----Instances
- local Player = game.Players.LocalPlayer
- local Char = Player.Character
- local Root,Head,Hum = Char.HumanoidRootPart,Char.Head,Char.Humanoid
- ---- Function
- local function Vault()
- if VaultDB == false then
- VaultDB = true
- --- raycasting RAHHHHHHHH!!!
- local raycastParams = RaycastParams.new()
- raycastParams.FilterDescendantsInstances = {Char}
- local raycastOrigin = Root.CFrame.Position
- local raycastDirection = Root.CFrame.LookVector
- local raycastLength = 1
- local result = workspace:Raycast(raycastOrigin, raycastDirection * raycastLength, raycastParams)
- if result then
- -- Not a character or ToolHandle, no riding allowed!!!
- if result.Instance.Parent:FindFirstChild("Humanoid") == nil and result.Instance.Name ~= "Handle" then
- local Part = result.Instance
- if Head.Position.Y > Part.Position.Y + Part.Size/2 then
- ----Tween
- local VaultTweenInf = TweenInfo.new(0.2, Enum.EasingStyle.Linear,Enum.EasingDirection.In)
- local VaultTween = TweenService:Create(Root,VaultTweenInf, {CFrame = Root.CFrame * CFrame.new(0,3,1) })
- Root.Anchored = true
- VaultTween:Play()
- task.wait(0.2)
- Root.Anchored = false
- end
- end
- end
- VaultDB = false
- end
- end
- InputService.InputBegan:Connect(function(input, GameProcessed)
- if not GameProcessed then
- if input.Keycode == Enum.Keycode.Space then
- if Hum.FloorMaterial == Enum.Material.Air and Hum.Health > 0 then
- Vault()
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement