function onClick(player) local check = player.Parent:FindFirstChild("Humanoid") if check ~= nil then local user = game.Players:GetPlayerFromCharacter(player.Parent) print(player.Name.." was found!") end end script.Parent.ClickDetector.MouseClick:connect(onClick)
function onClick(player) if player.Character:FindFirstChild("Humanoid") then -- we don't need to use that variable for the check. print(player.Name.." was found!") end end script.Parent.ClickDetector.MouseClick:connect(onClick)
When using onclicked, the part that clicked it doesn't return. what returns is the player that clicks it.