Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to detect two parts collision?

Asked by 2 years ago

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.

0
if it doesn't work dm me at discord Blue Duck#8344 WINDOWS10XPRO 438 — 2y

2 answers

Log in to vote
0
Answered by 2 years ago
local part1 = putpart1here
local part2 = putpart2here

part1.Touched:Connect(function(hit)
    if hit == part2 then
        -- script here
    end
end)
Ad
Log in to vote
0
Answered by 2 years ago
local part1 = part1whereveritis
local part2 = part2whereveritis

part1.Touched:Connect(function(hit)
if not hit.Parent:FindFirstChild("Humanoid") and hit.Parent == part2 then

    end
end)

Answer this question