Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you send Mouse to server while FE is on?

Asked by 7 years ago

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?

0
You can't. Your not playing at ROBLOX's servers so ROBLOX's servers don't have your mouse. hiimgoodpack 2009 — 7y

1 answer

Log in to vote
4
Answered by
DanzLua 2879 Moderation Voter Community Moderator
7 years ago
Edited 7 years ago

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.

0
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) SkeletalReality 590 — 7y
0
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. ThePhantomG 30 — 7y
0
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) Pejorem 164 — 7y
0
can only be ran by the client* hiimgoodpack 2009 — 7y
0
@hiimgoodpack LOL didnt see that DanzLua 2879 — 7y
Ad

Answer this question