Invalid argument #1 to 'new' (Vector3 expected, got number)

(error is on line 20)
code:

local Remote = game.ReplicatedStorage:WaitForChild("Magic")

Remote.OnServerEvent:Connect(function(Player,Action,MouseHit)
	local Char = Player.Character
	local Hum = Char:WaitForChild("Humanoid")
	local HumRP = Char:WaitForChild("HumanoidRootPart")
	
	local FX = script:WaitForChild("FX")
	local Sounds = script:WaitForChild("Sounds")
	local Anims =  script:WaitForChild("Anims")
	
	local TS = game:GetService("TweenService")
	
	if Action == "Z" then
		local Spear = FX.PlasmaSpear:Clone()
		Spear.Parent = workspace
		Spear.CFrame = HumRP.CFrame * CFrame.new(0,-5,0)
		Spear.CFrame = CFrame.new(Spear.Position,MouseHit.p)
		
		local Tween = TS:Create(Spear,TweenInfo.new(3),{CFrame = Spear.CFrame * CFrame.new(0,0.-130)})
		Tween:Play()
		
		game.Debris:AddItem(Spear,2.5)
		
		delay(2.2, function()
			local Tween = TS:Create(Spear,TweenInfo(0.3),{Transparency = 1})
			Tween:Play()
		end)
	end
end)

There is a point instead of a comma, that’s why you interpret it as the 3rd way to build a CFrame (CFrame from 2 vectors).

local Tween = TS:Create(Spear,TweenInfo.new(3),{CFrame = Spear.CFrame * CFrame.new(0,0,-130)})
1 Like

oh thanks I kept on brushing over it