Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to un-anchor a part using script?

I want to make a bulldozer that can destroy buildings. and I wanted to make a script that would be inside a part that's in front of the vehicle.

script.Parent.Touched:Connect(function(hit)

		hit.Anchored = false
end)

but when any brick hits the part it doesn't get unacnored

1 answer

✓ Accepted answer

First of all, you want to rename all the bricks you want un-anchored to the same name.

script.Parent.Touched:Connect(function(hit) --touch function
	if hit.Name == "BuildingBrick" and hit:IsA("Part") then --Checks if the touched object is a part called "BuildingBrick"
		hit.Anchored = false --sets the anchored to false
	end
end)

2 comments

0

Thanks

0

No problem.

This discussion is preserved as it was. New answers, comments, and votes are closed.