Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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)

2 comments

0

Ty :D

0

No problem! :D

This discussion is preserved as it was. New answers, comments, and votes are closed.