# Help With Cloning My BodyVectors

Okay here is my code.

local Service = game:GetService("UserInputService")

local Humanoid = script.Parent:WaitForChild("HumanoidRootPart")

local Vector = Instance.new("BodyVelocity")
local Up = Vector.MaxForce == "400000000000, 400000000000, 400000000000" and Vector.Velocity == "0,0.5"
local NewUp = Up:Clone().Parent

Service.InputBegan:connect(function(input, recieved)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.W then
NewUp = Humanoid

elseif input.KeyCode == Enum.KeyCode.A then

elseif input.KeyCode == Enum.KeyCode.S then

elseif input.KeyCode == Enum.KeyCode.D then

end
end
end)

My issue is saying It canâ€™t index with the boolean â€śCloneâ€ť

Thank you for your time!

FYI The code is not finished, so I have no idea if it matters or not.

You have a double equals sign, which is comparing Vector.Velocity with â€ś0,0.5â€ť, and so youâ€™re returning a boolean.

1 Like

So then what would I do? I havenâ€™t really work with anything that involves Values before.

Thereâ€™s a few things wrong here. You canâ€™t set these values as strings, they need to be a Vector3. Also, you should set MaxForce and Velocity on separate lines. And thereâ€™s no point to your Up variable because youâ€™re just altering the properties of your Vector variable.

local Vector = Instance.new("BodyVelocity")
Vector.MaxForce = Vector3.new(math.huge, math.huge, math.huge) -- math.huge more efficient
Vector.Veclocity = Vector3.new(0, 0.5, 0) -- needs to be 3 dimensions, not two
NewUp = Vector:Clone()
1 Like

Oh I see, Thank you very much! : D