How would you make something that, when clicked, checks if one brick is touching another brick, then does what the script says? Would it be like,
script.Parent.ClickDetector.mouseClick:connect(function()
if function onTouched(hit) then
--script
else
-- script
end)
script.Parent.Touched:connect(onTouched)
I want the onTouched(hit) to be, if object 1 is touching object 2, then run the script. If object 1 isn't touching object 2, then run a different script. Any help would be appreciated.
I'm currently using the script
script.Parent.ClickDetector.mouseClick:connect(function()
script.Parent.Parent.B3.AlignPosition.Enabled = false
wait(.5)
script.Parent.Parent.B3.AlignPosition.Enabled = true
wait(.5)
script.Parent.Parent.B3.AlignPosition.Enabled = false
wait(.5)
script.Parent.Parent.B3.AlignPosition.Enabled = true
wait(.5)
script.Parent.Parent.B3.AlignPosition.Enabled = false
end)
B3 being the object that is moving.

3 comments
Thank you so much! The script i'm currently using is:
Better edit your post imo...
Sorry about that. Just edited the post to show the script i'm currently using.