How can I get the players mouse without using mouse?

Im trying to get rid of deprecated features in my game. I was wondering on how I could get the players position without using mouse. Ive seen a couple of examples of it, but they didnt seem to work.

https://developer.roblox.com/en-us/api-reference/function/UserInputService/GetMouseLocation

you said, they didn’t seem to work, just incase you dont know, it should be done in a local script

you should use

Player:GetMouse()

which returns a Mouse Object, Which you can read more about here;
https://developer.roblox.com/en-us/api-reference/class/Mouse