Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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.

1 comment

0

Oh I see guess sending Mouse.Hit.p to the server when Mouse.Move event fires is the only way. Thanks.

This discussion is preserved as it was. New answers, comments, and votes are closed.