Invalid argument #2 (Vector3 expected, got nil) on line 26, any help would be nice.
game:GetService("ReplicatedStorage").Grab.OnServerEvent:Connect(function(player, status, mousepos)
local chr = player.Character
local human = chr.Humanoid
local hrp = chr.HumanoidRootPart
local stand = chr:WaitForChild("Stand")
local character = workspace:WaitForChild(player.Name)
local humanoid = character:WaitForChild("Humanoid")
local hitbox = stand:WaitForChild("Hitbox")
local debounce = false
local debounce2 = false
if status == "Grab" then
hitbox.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not debounce and hit.Parent.Humanoid ~= humanoid then
debounce = true
local char = hit.Parent
local weld = Instance.new("Motor6D")
weld.Parent = char.Torso
weld.Part0 = char.Torso
weld.Part1 = hitbox
wait(1.7)
debounce2 = true
weld:Destroy()
wait(0.1)
char.HumanoidRootPart.Velocity = CFrame.new(hitbox.Position, mousepos).lookVector * 5000
end
end)
end
end)