is there any way for me to find out which part was played? Whether it was Coin2 or Coin3? script:
local player = game.Players.LocalPlayer
function touch (hit)
print("touch")
print("Part "..Coin3 or Coin2 "touched")
end
workspace.Coin3.Touched:Connect(touch)
workspace.Coin2.Touched:Connect(touch)

10 comments
the problem is that i needed it in one function
ok i will edit the answer with the new code in a second
@lytew check the new code
ok
what exactly does this script do?
check if a coin was touched and prints out the coin that was touched
oh man thanks! I'll try to edit it here, it will help a lot, really!
be sure to accept the answer if it works
There is no need to check the name of hit. You can concatenate the print() with the name of the hit part.
There is no need to check the name of hit. You can concatenate the print() with the name of the hit part.