Add 2 onto the X value of a vector3

I’m trying to make a detain tool and I’m having trouble teleporting the detainee in front of the player. How would I get the players position and then add 2 onto the X value? I’ve looked around but I can’t find anything.

TL;DR, How do I add 2 onto a vector3 X value


You can just create a new Vector3 value with the value of X set to 2 and add that to player’s position.

local HumanoidRootPart = --Put the reference to HumanoidRootPart here
HumanoidRootPart.Position +=, 0, 0)

It’s now just teleported itself to the X position of 2.

Nevermind that was a problem with my script not yours.