Suppose that i want to get LocalPlayer's Mouse, and pass it to the server how would i do it? Also, if I want to do it with filtering enabled, how would i do it?
✓ ANSWER ACCEPTED
Passing GetMouse() between scripts?
1 answer
✓ Accepted answer
You unfortunaly can't do this.
it looks like you can do the following, but that only works in studio. If you want to use anything of the mouse inside of the server, you should send all the things you want to send to the server seperatly. (Event:FireServer(mouse.Target,mouse.hit.p) etc.)
----{WARNING}This code only works in studio because everything counts as local.{WARNING}-----
--localscript
local mouse = game.Players.LocalPlayer:GetMouse()
onDesiredEventTrigger:Connect(function()
game.ReplicatedStorage.Event:FireServer(mouse)
end)
--server
game.ReplicatedStorage.Event.OnServerEvent:Connect(function(player,mouse)
--do stuff with mouse
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks for Replying. I after all managed to get it working later after going through docs. Again Thanks