How can i get the player using their humanoid?

How could I get the Player from a character with a humanoid? Here’s the script I have trying to get the player:

script.Parent.Touched:Connect(function(hit)
	local humanoid = hit.Parent.Humanoid
	if humanoid then
		local player = humanoid.Player
		player.PlayerGui.DemoEnd.Frame.Script.Enabled = true
		game.Workspace.Fade:Play()
	end
end)```
1 Like

The correct search inputs which you should input into google search to get the correct solution should be getting player from a touched event as touched event is the main source on information.

This post should be the solution:

1 Like

This works perfectly, thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.