Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

attempt to perform arithmetic (add) on number and Vector3 (error pls help?)

Asked by 2 years ago
local TweenService = game:GetService("TweenService")
local RA = script.Parent.Parent
local rah = script.Parent

rah.Parent = RA
rah.CFrame = RA.CFrame
rah.Weld.Part0 = RA

rah.Orientation.Y = rah.Orientation.Y + Vector3.new(0, 130.68, 0) -- This is the line that errors

TweenService:Create(rah, TweenInfo.new(1.3), {Size = rah.Size * 2, Transparency = 1}):Play()
game.Debris:AddItem(rah, 1.3)

I just want the part to rotate its orientation a bit but it errors.

It's a mesh part inside of a character's right arm.

The code above is inside a server script

There is a weld instance inside the mesh part which has the weld Part1 set to the mesh part and of course, the script sets the weld Part0 in the script above.

The tween just makes it grow a bit then disappear.

1
Orientation is a vector, you get the Y axis of that vector (so basically you get a number), you try adding the number to a new vector and furthermore errors greatneil80 2647 — 2y
0
rah.Orientation = rah.Orientation + Vector3.new(0, 130.68, 0) seems good for me as both are vectors now TerranRecon 49 — 2y

Answer this question