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

How do you get the player's humanoid that touched or clicked a brick?

Asked by
nap516 87
7 years ago

So if I like wanted to make the player sit I would need to find the humanoid of the player who touched or the player that clicked. But I don't know how to find it.

Help

1 answer

Log in to vote
0
Answered by
Mayk728 855 Moderation Voter
7 years ago
Edited 7 years ago

You should use the part's Touched event.

Script inside a part:

script.Parent.Touched:Connect(function(hit) --hit is the part that touched the current part.
    if hit.Parent and hit.Parent:FindFirstChild('Humanoid') then --Since a part touched the current part, we use "hit.Parent" which would equal to the character.
        print('Found player!')
        hit.Parent.Humanoid.Sit = true
    end
end)
0
Ty :D nap516 87 — 7y
0
No problem! :D Mayk728 855 — 7y
Ad

Answer this question