Mysterial_12
(goinghamonmyshi)
#1
I was writing a script and then realized I may have set up the player’s mouse wrong but everything checks out for me. Am I forgetting something?

I’m simply printing the variables to test what I did wrong but the error says:
Workspace.Part.Script:3: attempt to index nil with ‘GetMouse’
nonamehd24
(nonamehd24)
#2
Maybe its because Players.LocalPlayer is nil on a Server Script?
OwlCodes
(Owl)
#3
Only LocalScripts can get the players mouse.
Even if you had the Player on the server you wouldn’t be able to get the mouse.
1 Like
rorystxr
(rorystar)
#4
you cant grab the player from the server, youd have to use a local script
Bankrovers
(Bankrovers)
#5
LocalScript:
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local mouse = player:GetMouse()
print(mouse)
