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
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
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Ty :D
No problem! :D