Wall climbing system is not working

  1. What do you want to achieve?

So I am adding a wall climbing for my game, I am not a scripter so I use an open source I found then I try to understand the script and make it go left and right too instead of only going up and down only

  1. What is the issue?

There’s an error and I don’t know how to fix it and what it means. The script is not working I don’t know why

  1. Requested module experienced an error while loading
    2 .Unable to load rbxasset://avatar/characterR15.rbxm

I clicked on the error and nothing happen

  1. What solutions have you tried so far?

I tried searching this but still got no idea how to fix it. here is the code

local UIS = game:GetService("UserInputService")

local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local HRP = Char:WaitForChild("HumanoidRootPart")
local Hum = Char:WaitForChild("Humanoid")
local Head = Char:WaitForChild("Head")

local HittingWall = false
local OnWall = false

local Normal
local Pos
local Wall
local previousWall

function upclimb()
	if HittingWall == true then
		HRP.Velocity = Vector3.new(0,0,0)
		HRP.Anchored = false
		if OnWall then

			local bv = HRP:FindFirstChild('BV')
			bv.Velocity = HRP.CFrame.LookVector * 0 + Vector3.new(0, 12.5, 0)
		end
	end
end

function downclimb()
	if HittingWall == true then
		HRP.Velocity = Vector3.new(0,0,0)
		HRP.Anchored = false
		if OnWall then

			local bv = HRP:FindFirstChild('BV')
			bv.Velocity = HRP.CFrame.LookVector * 0 + Vector3.new(0, -12.5, 0)
		end
	end
end

function rightclimb()
	if HittingWall == true then
		HRP.Velocity = Vector3.new(0,0,0)
		HRP.Anchored = false
		if OnWall then

			local bv = HRP:FindFirstChild('BV')
			bv.Velocity = HRP.CFrame.LookVector * 0 + Vector3.new(12.5, 0, 0)
		end
	end
end

function leftclimb()
	if HittingWall == true then
		HRP.Velocity = Vector3.new(0,0,0)
		HRP.Anchored = false
		if OnWall then

			local bv = HRP:FindFirstChild('BV')
			bv.Velocity = HRP.CFrame.LookVector * 0 + Vector3.new(-12.50, 0, 0)
		end
	end
end


function upclimboff()
	HRP.Anchored = true
	local bv = HRP:FindFirstChild('BV')
	bv.Velocity = HRP.CFrame.LookVector * 0 + Vector3.new(0, bv.Velocity.Y - 12.5, 0)
end

function downclimboff()
	HRP.Anchored = true
	local bv = HRP:FindFirstChild('BV')
	bv.Velocity = HRP.CFrame.LookVector * 0 + Vector3.new(0, bv.Velocity.Y + 12.5, 0)
end

function rightclimboff()
	HRP.Anchored = true
	local bv = HRP:FindFirstChild('BV')
	bv.Velocity = HRP.CFrame.LookVector * 0 + Vector3.new(bv.Velocity.X - 12.5, 0, 0)
end

function leftclimboff()
	HRP.Anchored = true
	local bv = HRP:FindFirstChild('BV')
	bv.Velocity = HRP.CFrame.LookVector * 0 + Vector3.new(bv.Velocity.Y + 12.5, 0, 0)
end


spawn(function()
	while game:GetService('RunService').RenderStepped:Wait() do
		local r = Ray.new(Head.CFrame.p,Head.CFrame.LookVector * 5)
		local hit, pos, normal = workspace:FindPartOnRay(r,Char)

		if hit then
			if hit.Name == "WallClimb" then
				HittingWall = true

				Pos = Pos 
				Normal = normal
				Wall = hit
				previousWall = hit
			end
		end

		if not hit then
			if HRP:FindFirstChild("BV") and OnWall then
				local bv = HRP:FindFirstChild("BV")
				bv.Velocity = Vector3.new(0,0,0)
				bv.Velocity = HRP.CFrame.lookVector * 10 + Vector3.new(0,40,0)

				game.Debris:AddItem(bv,.15)
				OnWall = false
				Hum.AutoRotate = true
				Hum.PlatformStand = false

			elseif HRP:FindFirstChild("BV") == nil and OnWall then
				local bv = Instance.new("BodyVelocity",HRP)
				bv.MaxForce = Vector3.new(1,1,1) * math.huge
				bv.Velocity = HRP.CFrame.LookVector * 10 + Vector3.new(0,40,0)

				game.Debris:AddItem(bv,.15)
				OnWall = false
				Hum.AutoRotate = true
				Hum.PlatformStand = false

			end

			Pos = nil
			normal = nil
		end
		wait()
	end
end)

UIS.InputBegan:Connect(function(Key,Chat)
	if Key.KeyCode == Enum.KeyCode.X and not Chat then
		if HittingWall == true then
			if not OnWall then
				if Normal == nil then return end
				OnWall = true
				HRP.CFrame = CFrame.new(HRP.CFrame.p,Vector3.new(HRP.Position.X - Normal.x,HRP.Position.Y,HRP.Position.Z - Normal.z)) 

				local bv = Instance.new("BodyVelocity",HRP)
				bv.MaxForce = Vector3.new(1,1,1) * math.huge
				bv.Velocity = HRP.CFrame.LookVector * 0
				bv.Name = "BV"

				Char.Humanoid.AutoRotate = false
				Char.Humanoid.PlatformStand = true
			else
				HRP:FindFirstChild("BV"):Destroy()
				Char.Humanoid.AutoRotate = true
				Char.Humanoid.PlatformStand = false
				OnWall = false
			end
		end
	elseif Key.KeyCode == Enum.KeyCode.W and not Chat then
		upclimb()
	elseif Key.KeyCode == Enum.KeyCode.S and not Chat then
		downclimb()
	elseif Key.KeyCode == Enum.KeyCode.A and not Chat then
		leftclimb()
	elseif Key.KeyCode == Enum.KeyCode.D and not Chat then
		rightclimb()
	end
end)

UIS.InputEnded:Connect(function(Key,Chat)
	if Key.KeyCode == Enum.KeyCode.W and not Chat and OnWall then
		upclimboff()

	elseif Key.KeyCode == Enum.KeyCode.S and not Chat and OnWall then
		downclimboff()
	elseif Key.KeyCode == Enum.KeyCode.A and not Chat and OnWall then
		leftclimboff()
	elseif Key.KeyCode == Enum.KeyCode.D and not Chat and OnWall then
		rightclimboff()
	end
end)
1 Like

Is there a possibility, that the error was caused by a plugin?

Can’t tell why the script isn’t working.

1 Like

I tried to disable all the plugins now, the errors are gone but the script still not working. Maybe there’s something wrong with my studio :confused: I’m pressing every keys on my keyboard still no

At this point, you should try debugging you code.

By putting a print() on a line you think the script decides to not work.

Or printing if the player is on the wall.

1 Like

There is a very high possibility it was caused by a spelling error or a missing value. Try running the script and look in the terminal for error codes.