My wallrunning script doesn't work

Hi! I wanted to implement a Wallrun feature into my game but the script does not work for some reason. Here is the local script

local hrp = char:WaitForChild("HumanoidRootPart")
local hum = char:WaitForChild("Humanoid")

local ava = true
local has = false
local hold = false
local left = false
local right = false
local leftPlaying = false
local rightPlaying = false
local RA = hum:LoadAnimation(char:WaitForChild("RunAnimRIGHT"))
local LA = hum:LoadAnimation(char:WaitForChild("RunAnim"))
local Vel = Instance.new("BodyVelocity",hrp)
local BGO = Instance.new("BodyGyro",hrp)
BGO.D = 100
BGO.P = 10000
BGO.MaxTorque = Vector3.new(0,0,0)
BGO.Name = "Rot"
Vel.MaxForce = Vector3.new(0,0,0)
Vel.Name = "Vel"

function render()
	local r = Ray.new(hrp.CFrame.p, hrp.CFrame.rightVector * -3)
	local r2 = Ray.new(hrp.CFrame.p, hrp.CFrame.rightVector * 3)
	local part, position, normal = workspace:FindPartOnRayWithIgnoreList(r,{char})
	local part2, position2, normal2 = workspace:FindPartOnRayWithIgnoreList(r2,{char})
	local cross = Vector3.new(0,1,0):Cross(normal)
	local cross2 = Vector3.new(0,1,0):Cross(normal2)
	
	if (part and ava) or (part2 and ava) then
		if (part and part.Name == "Wallrun") or (part2 and part2.Name == "Wallrun") then
			if part then
				hrp.CFrame = CFrame.new(hrp.CFrame.p.Vector3.new(hrp.Position.X + cross.x, hrp.Position.Y, hrp.Position.Z + cross.z))
				elseif part2 then
				hrp.CFrame = CFrame.new(hrp.CFrame.p.Vector3.new(hrp.Position.X - cross2.x,hrp.Position.Y,hrp.Position.Z - cross2.z))
				end
			has = true
			hold = true
			if hold then
				BGO.CFrame = hrp.CFrame
				BGO.MaxTorque = Vector3.new(1,1,1) * math.huge
				Vel.MaxForce = Vector3.new(1,1,1) * math.huge
				hold = false
				if part then
					Vel.Velocity = cross * 50
					left = true
				elseif part2 then
					Vel.Velocity = -cross2 * 50
					right = true
				end
			end
		end
	elseif (ava and not part and not part2 and has and not hold) then
		BGO.MaxTorque = Vector3.new(0,0,0)
		Vel.MaxForce = Vector3.new(0,0,0)
		ava = false
		left = false
		right = false
		LA:Stop() RA:Stop()
		if has then
			wait(0.5)
			ava = true
			has = false
		end
	end
	
	if left and not leftPlaying then
		LA:Play()
		leftPlaying = true
	elseif not left then
		LA:Stop()
		leftPlaying = false
	end
	
	if right and not rightPlaying then
		RA:Play()
		rightPlaying = true
	elseif not right then
		RA:Stop()
		rightPlaying = false
	end
end

game:GetService("RunService").RenderStepped:Connect(render)```

The error is

> Vector3 is not a valid member of Vector3  -  Client - WallRun:34

Please edit your post and surround your code with backticks
```
like this
```
so it shows up

like this

:slight_smile:

Thank you. I am new to DevForum. I appreciate it!

Not sure what you indended to do here, but hrp.CFrame.p.Vector3.new isn’t valid.

The tutorial I followed used this for some reason. Would You recommend another tutorial?

Are you sure that’s what they did? It would give them an error as well.

Also change RenderStepped to Stepped in your last line. It won’t fix this bug, but you still should :slight_smile:

I would maybe recommend starting with something simpler than this, if you’re just trying to learn how to script.

Can’t really tell what the line is supposed to be. If I had to guess they meant CFrame.p + Vector3.new, but that’s just a guess.