LinearVelocity is not a valid member of MeshPart

Hello, I’m trying to throw a tool. I copied code from another question. And surprisingly it kinda works, but I’m getting an error.
LinearVelocity is not a valid member of MeshPart I have LinearVelocity under Handle. So I’m not sure why this is happening.

image

Code

local tool = script.Parent
local UIS = game:GetService("UserInputService")
local Power = 50 -- Or however far you want it to go
local Character 
local Equipped = false
tool.Equipped:Connect(function()
	Character = tool.Parent
	Equipped = true 
end)
tool.Unequipped:Connect(function()

	Equipped = false 
end)
UIS.InputBegan:Connect(function(key, gp)
	if gp then return end
	if key.KeyCode == Enum.KeyCode.E and Equipped == true then
		tool.Parent = workspace
		tool.Handle.Position = Character.PrimaryPart.Position + Character.PrimaryPart.CFrame.LookVector * 3
		tool.Handle.LinearVelocity = Character.PrimaryPart.CFrame.LookVector * Power
	end
end)

tool.Handle.LinearVelocity = ...
This would interpret LinearVelocity as a property, because it’s not possible to set an instance like that (for example workspace.Part = nil won’t work).

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.