So I have a script where I get the cursor position. But here’s the question, how do I know if the player is pointing the cursor at another player? If he did, then print something
local Player = game:GetService('Players').LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Move:Connect(function()
print(Mouse.X)
print(Mouse.Y)
end)
local Player = game:GetService('Players').LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Move:Connect(function()
local target = Mouse.Target
if (not target) then return end
local plr = game:GetService('Players'):GetPlayerFromCharacter(target.Parent)
if plr then
print(plr.Name)
end
end)