if hit == obj or hit:FindFirstAncestor(obj.Parent.Name) and obj.Parent.HumanoidRootPart.AssemblyLinearVelocity > 1 then
at this line, i get the following error:
i know its because of the number, but i also dont know any other way to replace the number, as i want it to watch for a velocity above 1 in ANY direction when a raycast hits the player. any help?
ive used this before from a comment in a tutorial, and it actually didnt really help. it would stabily not kill the player at like 150 if they had no tool out, but would kill the player if they had, for example, a flashlight out
You need to specify which component of the vector3 you want to compare to 1.
if hit == obj or (hit:FindFirstAncestor(obj.Parent.Name) and obj.Parent.HumanoidRootPart.AssemblyLinearVelocity.x > 1) then
-- code to execute if the condition is true
end
I have added parentheses to group the “and” expression together and specified that I want to compare the x-component of the vector3 value “AssemblyLinearVelocity” to the number 1.