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)
✓ ANSWER ACCEPTED
Where did i go wrong? Output tells me nothing..
1 answer
✓ Accepted answer
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
