How do you create a when touched system when a player touches a part?

This is not regarding the issue just a helpful tip
dont code touched event on a local script and .LocalPlayer can only be found on a local script its extremly important that as a new programmer you understand when to use local Scripts and server scripts so read up on them as much as possible: