Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

lookvectror isnt a valid member?

i am making a slide mechanic and i get the error in the title pls help this is my script

local uis = game:GetService("UserInputService")
local char = script.Parent

local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://6836874114"

local keybind = Enum.KeyCode.LeftControl
local cs = true

uis.InputBegan:Connect(function(input,gameprocessed)
	if gameprocessed then return end
	if not cs then return end
	
	if input.KeyCode == keybind then
		cs = false
		
		local playanim = char.Humanoid:LoadAnimation(anim)
		playanim:Play()
		
		local slide = Instance.new("BodyVelocity")
		slide.MaxForce = Vector3.new(1,0,1) * 30000
		slide.Velocity = char.HumanoidRootPart.LookVector * 100
		slide.Parent = char.HumanoidRootPart
		
		for count = 1,8 do
			wait(0.1)
			slide.Velocity *= 0.7		
		end
		playanim:Stop()
		slide:Destroy()
		cs = true
	end
end)

1 comment

1

use “HumanoidRootPart.CFrame.LookVector”

2 answers

Just like SpeedMask said in the comments

You can only use Instance.CFrame.LookVector

again all credit to SpeedMask

oh well i solved it myself before anyone answered LOL

This discussion is preserved as it was. New answers, comments, and votes are closed.