Error: attempt to perform arithmetic (sub) on Vector3 and number?

Hey, i am trying to re-create the Jujutsu Kaisen’s technique: Cursed Technique Reversal: Red.
And, i am trying rn to make that the fx clones to the arm position, but for some reason i always get the error: “attempt to perform arithmetic (sub) on Vector3 and number”.

Here is my code:

local revRedGfx = game:GetService("ReplicatedStorage"):WaitForChild("RevRedCircleFx")
script.Parent.MouseClick:Connect(function(plr)
	local anim = Instance.new("Animation")
	local id = script.Animation.AnimationId
	anim.AnimationId = id
	local hum = plr.Character:WaitForChild("Humanoid")
	local track = hum.Animator:LoadAnimation(anim)
	track.Priority = Enum.AnimationPriority.Action4
	track:Play()
	wait(.80)
	script.Sound:Play()
	wait(11.5)
	local revRedNew = revRedGfx:Clone()
	local armPos = plr.Character["Right Arm"].Position
	revRedNew.Parent = workspace
	revRedNew.Position = Vector3.new(armPos, armPos -.9, armPos + .6)
end)

help pls, ty yall

1 Like

which line does it error on? This would help a lot

1 Like

You’re applying a Vector3 value within one of its axes instead of a number, get the data from their specific axis. (eg: Position.X, Position.Y, and Position.Z)

2 Likes

Workspace.btn.ClickDetectorScript:16

1 Like

ur adding a vector3 with a number,
I think what u what meant is to get the components of the vector
it will look like this:

revRedNew.Position = Vector3.new(armPos.X, armPos.Y -.9, armPos.Z + .6)
4 Likes

Hi!
You’re trying to add Vector3 inside a Vector3, since you are adding the armPos which is already one.

revRedNew.Position = Vector3.new(armPos.X, armPos.Z -.9, armPosZ + .6)

I’d also advise to use task.wait() instead of wait() since it’s deprecated and to connect to a named function instead of using a lambda (anonymous) function since it could use more memory overtime.

1 Like

Alr got it, thanks!:DD


1 Like

thankss


1 Like

Oh, ill take that in mind, thank you!


2 Likes

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