Hi. I'm tying to make a script run only if it touches a specific brick. The current script I have is
local function onTouch(hit)
if (hit.Parent.Parent.Parent) then
print(hit)
script.Parent.Parent.J.AlignPosition.Enabled = true
wait(5.3)
script.Parent.Parent.J.AlignPosition.Enabled = false
end
end
script.Parent.Touched:connect(onTouch)
I want it so that if it touches a specific other brick, it'll run. Any help will be appreciated. Thanks.

2 comments
I'll look in to modules, seems a lot better. Thank you so much!
np