I was doing some testing with mouse.target and I tried sharing the mouse.target information across the client/server boundary. I created a remote event for the local script to fire then i created a script to detect if the the remote event has been fired then print out mouse.target, but it just prints out the players name. When i tried printing mouse.target with the local script it worked.
heres my code
--- local script
local players = game:GetService("Players")
local player = players.LocalPlayer
local UIS = game:GetService("UserInputService")
local debounce = false
local mbs = player.PlayerGui
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
print("worked")
local char = game.Workspace:FindFirstChild(player.Name)
print(mouse.Target)
char.grab:FireServer(mouse.Target:GetFullName()) --- I also tried using mouse.target and creating a variable
end)
mbs.mobilebuttons.kick.MouseButton1Click:Connect(function()
print("worked")
end)
--- server script
script.Parent.grab.OnServerEvent:Connect(function(part)
print(part)
end)
perhaps im doing something wrong?