I have been trying to make a client script send the Mouse.Hit.Position value to a ServerScript using a RemoteEvent, however, whenever I fire the remote event and send the value, on the serverside it turns out as the player instance, which causes an error. Is there any solution to this?
I’ve been trying for multiple hours now to find the solution but I can’t.
LocalScript:
wait(1)
local plr = game.Players.LocalPlayer
while true do
local mouse = plr:GetMouse()
local pos = mouse.Hit.Position
print(pos)
script.Parent.ChangeMousePos:FireServer(pos)
wait()
end
It doesn’t turn into a player, when you use OnServerEvent the first parameter is the player and the rest are the ones that you put, so the server-sided script should look like this: