The following script gets all the player's names once the script's parent (Part) is touched.
local debounce = false
script.Parent.Touched:connect(function(hit)
if not debounce then
debounce = true
local list = {}
for i, plr in pairs(game.Players:GetPlayers()) do
table.insert(list, plr.Name)
msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = table.concat(list, "")
end
debounce = false
end
end)
What would I need to do to this script to only get 1 player's name instead of them all?

2 comments
Don't search through the players, check if hit.Parent is a humanoid, then use the :GetPlayerFromCharacter() method.
This script is going to be for a leaderboard that is displayed in a GUI at the end of the game. I only used the onTouched() function to test it. I know what you're saying, though.