How to find out the name of a part when touched by it.
local PartToBeTouched = game.Workspace.Part --Name this whatever... PartToBeTouched.Touched:connect(function(TouchingPart) print(TouchingPart.Name) end)
You can do it by using the "OnTouched" event on a part which will fire when "PartToBeTouched" is touched, and the argument is the part which touched it.
Usually, parts in workspace have the same name, so the script that the previous person has provided may not necessarily work. Though it is not recommended, you can add a script under the part. (For me personally, it is very unorganized and I heard it contributes to server lag)
local part = script.Parent part.Touched:connect(function(touchpart) print(touchpart.Name) end) -- This script goes under the part.
But yes, the scripts are basically the same.