This is the script. It produces no errors in the output, but doesn’t do its job.
this is the script I am using:
local Plane = game.Workspace.Plane1
local Weld = game.Workspace.Plane1.root.BTWeld
local terrain = game.Workspace.Terrain
function OnTouch(Terrain)
game.Workspace.Plane1.BTWeld:Destroy()
end
Hey, I’m glad to know you’re getting into scripting. I’m sorry you’re having issues, try this code:
workspace.Terrain.Touched:Connect(function(hit)
for i,v in pairs(hit:GetDescendants()) do
if v:IsA("Weld") then
v:Destroy()
end
end
end)
What this script does is it checks for any welds inside of a model, or a part that touches the Terrain. If it finds any, then it will delete the weld. If not, then nothing will happen. Good luck!
Edit: Also, regarding the script you tried at first. The reason why it didn’t work is because you’re defining a function, but not actually calling it once the plane hits the Terrain.