You can get the player using local player and player functions but how do you get it using the mouse? I've tried using Mouse.Target which gets non-living objects but it doesn't get the player. How do i get the player using the mouse?
local mouse = player:GetMouse()
local click = false
local function onclick()
if not click then
click = true
print(mouse.Target)
wait(0.5)
click = false
end
end
mouse.Button1Down:Connect(onclick)

1 comment
GetPlayerFromCharacter() on the parent of the BasePart that the mouse is pointing to