Hi, I asked a question earlier through wondering why my script isn't working that's getting fired from a Remote Function that accesses the mouse object through the Local Script, then transfers it to the script. But It doesn't work, It just says it's nil. Does anyone know a way to avoid this, or would a Remote Event work instead? Thanks.
Nil mouse is intentional because it's simply bad networking practice. Try to simply send a dictionary of the mouse properties if you need them so bad.
{Hit=mouse.Hit,Target=mouse.Target,X=mouse.X,Y=mouse.Y}
Plus anything else you want of course
If you want to send the request from the player's mouse target to the server then you must make sure from the Local script that it is a real object, and not nil
Here's an example script:
if mouse.Target then RemoteFunction:InvokeServer(mouse.Target) end --Or you could use this! if mouse.Target ~= nil then RemoteFunction:InvokeServer(mouse.Target) end