I want to do a code that will stop another code when one part touches another part. Is there a way to do that? Please help me.
Yes, there is two ways I can think of for this to happen.
Option 1
local partA = game.Workspace.PartA local partB = game.Workspace.PartB local scriptA = script local scriptB = game.Workspace.ScriptB partA.Touched:Connect(function(part) if part == partB then scriptB.Disabled = true end end)
Option 2
local partA = game.Workspace.PartA local partB = game.Workspace.PartB local stopcode = false partA.Touched:Connect(function(part) if part == partB then stopcode = true end end) if stopcode == false then -- code that could be stopped here end
If this helped, please consider upvoting!