Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- How To Make WALLCLIMB in Roblox Studio!! by BLOXIANCODE youtube.com/c/BloxianCode
- -- Tutorial: https://youtu.be/4vf8wg3rGlg
- local HumRootPart = script.Parent:WaitForChild("HumanoidRootPart")
- local humanoid = script.Parent:WaitForChild("Humanoid")
- local char = script.parent
- local part = nil
- local ClimbAnimation = humanoid:LoadAnimation(char.Animate.climb.ClimbAnim)
- game:GetService("RunService").Heartbeat:Connect(function()
- local params = RaycastParams.new()
- params.FilterDescendantsInstances = {char}
- if char:FindFirstChild("LeftFoot") then --checking if player is R15
- local result = workspace:Raycast(char.LeftFoot.Position, HumRootPart.CFrame.LookVector * 1.5, params)
- part = result and result.Instance or nil
- else
- local result = workspace:Raycast(char["Left Leg"].Position, HumRootPart.CFrame.LookVector * 1.5, params)
- part = result and result.Instance or nil
- end
- if part then
- HumRootPart.Velocity = Vector3.new(HumRootPart.Velocity.X, 15, HumRootPart.Velocity.Z) --15 is speed
- if humanoid:GetState() ~= Enum.HumanoidStateType.Climbing then
- humanoid:ChangeState(Enum.HumanoidStateType.Climbing)
- end
- if not ClimbAnimation.IsPlaying then
- ClimbAnimation:Play()
- end
- else
- ClimbAnimation:Stop()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement