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

Is it impossible to get a Player's Mouse and use it in a Global Script?

Asked by 7 years ago

So I'm making a game using Filtering Enabled and I'm using CFrame Animations to make the guns movement but the problem is Replication and constantly sending Data to the server through Remote Events isn't really that efficient and I've been trying to get the Mouse and send it to the server through a Remote Function but it isn't working as the "Mouse" returns nil.

I need the mouse since I'm using it to animate the weapon but it seems like the Mouse isn't really accessible through a Global Script.

1 answer

Log in to vote
1
Answered by 7 years ago
Edited 7 years ago

The Mouse is a only accessible. From the wiki "A Mouse object is not creatable" this means that only one Mouse will ever exist.

A remote event can have Variant args. There are fixed Data_types and Mouse in not one of them, again because it is not creatable.

You get the nil result as when the remote event gets the args it treats Mouse as a new variable which currently has no data.

Hope this helps, feel free to comment if I missed any points ect.

0
Oh I see guess sending Mouse.Hit.p to the server when Mouse.Move event fires is the only way. Thanks. Slazerick 55 — 7y
Ad

Answer this question