How to get x and y coordinates from CFrame

So basically making a drone that will drop a bomb at certain coordinates whenever the player fires and coordinates depend on the position of the camera. So I made a remote event that passes on the camera CFrame but I can’t get the X, and Z coordinates which I need help with.

You can either do:

local CFrameX = CameraCFrame.X
local CFrameZ = CameraCFrame.Z

or:

local CFrameX = CameraCFrame.Position.X
local CFrameZ = CameraCFrame.Position.Z

Ohhh I see I thought that CFrame didn’t have a inbuilt X and Y coordinate property thanks

local camera = workspace.CurrentCamera
local cameraCFrameX = camera.CFrame.X
local cameraCFrameY = camera.CFrame.Y
local cameraCFrameZ = camera.CFrame.Z

CameraCFrame isn’t defined here.

If you want CFrame values and not Vector3 values use the code I provided above.