Hi, I have a local script in the StarterPack with a server script with a remote in it. The problem is that I'm trying to pass the mouse argument to the remote and it keeps returning nil.
-- Server Script script.Script.OnServerEvent:connect(function(p,m) -- Local Script m = p:GetMouse() remote:FireServer(m)
This is probably really simple but I just can't find it out.
The mouse is client-side. Whenever you try to pass something through a RemoteEvent/Function that only exists on the server and not the client (or vice versa), it is replaced with nil
. (In this case, the client knows what the mouse is, but the server does not.)
If the server needs something regarding the mouse (ex. what the mouse is pointing at), simply pass that information to the server instead of the mouse.