Hello, I am wondering how to detect when two parts collide, and especially when the parts touch +1 will be added to the leaderstat. E.G when block1 touches block2 then it will +1 to the leaderstats. I know how to do this with humanoids as I know the certain function used but unable to know how to do it with 2 parts. If anyone could help that would be useful ty.
1 | local part 1 = putpart 1 here |
2 | local part 2 = putpart 2 here |
3 |
4 | part 1. Touched:Connect( function (hit) |
5 | if hit = = part 2 then |
6 | -- script here |
7 | end |
8 | end ) |
1 | local part 1 = part 1 whereveritis |
2 | local part 2 = part 2 whereveritis |
3 |
4 | part 1. Touched:Connect( function (hit) |
5 | if not hit.Parent:FindFirstChild( "Humanoid" ) and hit.Parent = = part 2 then |
6 |
7 | end |
8 | end ) |