Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to check if a player clicked on another player?

Asked by 4 years ago

I am trying to make handcuffs but how can I make this script work?

local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer -- from a LocalScript
local mouse = localPlayer:GetMouse()

mouse.MouseButton1Down:Connect(function()
    if mouse.Target.Parent:FindFirstChild("Humanoid") then
        print(mouse.Target.Parent)
    end
end)

Answer this question