How to get the cursor movement and camera of players?

Hi, I was wondering how I would go about smoothly grabbing the player’s current camera and cursor movement along with what keys they are pressing I’ve seen multiple games make this, and pretty much I’m attempting to recreate PvEye (ROBLOX 😱How to use Pveye - YouTube) Please watch this timestamp to see what I’m talking about. 2:03 Currently the way PvEye works is it’s spamming a remote constantly on the client I’ve seen multiple other games make their own PvEye without spamming a remote I’m just wondering how would I exactly go about recreating such thing.

For getting the player’s camera you can use:

local camera = game.Workspace.CurrentCamera

from a local script.
|
To get the position of that camera simply use

camera.CFrame

|
To get the player’s pressed key’s you can use:

game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcess)
     if gameProcess then
        return
     else
        print(input)
end)

from a local script aswell.
|
Getting the player’s mouse is also simple:

local mouse = game.Players.LocalPlayer:GetMouse()

from a local script.

Yes, but I’m attempting to recreate pveye just smoother.

You want to create a spectate gui? Tutorials for this have been written before.

You will need to fire a ‘RemoteEvent’ object every frame if you want the camera’s CFrame and mouse cursor’s screen position of a client to be shared with (an)other client(s).

RemoteEvent:FireServer(Camera.CFrame, Mouse.X, Mouse.Y) --Camera's 'CFrame' and mouse's 'X' and 'Y' axis screen position sent to the server.