local Ablock = game.workspace.A
local Bblock = game.workspace.B
while true do
local parttouchB = Bblock:GetTouchingParts() -- returns a table of parts intersecting B
for i,v in pairs(parttouchB) do
if v == Ablock then
Ablock.anchored = true
else
Ablock.anchored = false
wait()
end
end
end
Hello, I have received this script, So basically
When Part B touches part A, part A must be anchored else A must be unanchored.
The script I have works 100% OK, the only problem is that Part A & B won't always be in the workspace. They could be in groups with different names (Won't constantly be in the same location.)
Is there a way I can fix this?
Thanks

2 comments
btw it was my mistake, isnt it meant to be anchored instead of anchor
Thanks!