I'm trying to send the player's mouse to the server from the client, but Player:GetMouse() doesn't work how do you solve this?
How do you send Mouse to server while FE is on?
1 answer
The function :GetMouse() can only be ran on the client, and you cannot send the mouse itself over to the server using a remoteEvent, but you what you can do is send properties of the mouse over through a remoteEvent to the server.
--localscript
local mouse = plr:GetMouse()
remoteEvent:FireServer(mouse.Target)
--server
RemoteEvent.OnServerEvent:connect(function(Player,target)
end)
In this example I am sending the mouse's Target over to the server from the client.
5 comments
You can also get the player's mouse through server by the player's equipped tool (which is why lots of planes require you to hold a tool to maneuver it)
Yes, you can't send the whole mouse along because it doesn't work. Instead send part of it "mouse.target" to the server script.
You could easily reassign the mouse properties to a dictionary and send that as if it were the Mouse object at that instance in time (it wouldn't self update to align with the mouse object)
can only be ran by the client*
@hiimgoodpack LOL didnt see that
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You can't. Your not playing at ROBLOX's servers so ROBLOX's servers don't have your mouse.