why wont the nil work so you cant do the wallrun in air
game:GetService("RunService").Stepped:Connect(function()
character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
WallRun_Detect = 2.5
local rayLeft = Ray.new(character.HumanoidRootPart.CFrame.p, -character.HumanoidRootPart.CFrame.RightVector * WallRun_Detect)
local rayRight = Ray.new(character.HumanoidRootPart.CFrame.p, character.HumanoidRootPart.CFrame.RightVector * WallRun_Detect)
local right, rightPos = workspace:FindPartOnRay(rayRight, character, false, true)
local left, leftPos = workspace:FindPartOnRay(rayLeft, character, false,true)
print(left) print(right)
if character.Humanoid.FloorMaterial == Enum.Material.Air then
if rayLeft~=nil then
Left_Wallrun = character.Humanoid:LoadAnimation(script.LeftRunAnim)
Left_Wallrun:Play()
NonGrav = Instance.new("BodyVelocity",character:WaitForChild("Torso"))
NonGrav.MaxForce= Vector3.new(1,10,1)
NonGrav.Velocity=Vector3.new(0,1,0)
elseif rayRight~=nil then
end
else
Left_Wallrun:Stop(0)
wait(0.05)
Left_Wallrun:Destroy()
end
end)
--[[
this wont work
--]]
