i was making a script where when a player clicks the textbutton, a blueprint of a block (the shape of the block, just half transparent and blue) will follow the player's mouse
. i got it to work in test mode, and decided to test it in a server. all the part does is move to the center of the map, and stay there. i figured out that the problem was that i can't get a players mouse with a RemoteEvent
game.ReplicatedStorage.RemoteEvent.OnServerEvent:connect(function(plr) local mouse = plr:GetMouse()
does anyone know how i can accomplish this? i found another question on this site related to mine, and said to try using RemoteFunctions
. i have some what of an idea on what they do, but do not know how to use them, or how they could help this situation in any way.
It can't. For any reason you're trying to get the mouse on the server, you don't need to. If you want what the mouse is pointing at, use a remote function to retrieve that information.
You can't return the mouse in a remove function, because it'll turn into nil
when it tried to get sent to the server. Send the information you want from the mouse, but not the mouse itself.