What would be the best way to remove every WeldConstraint from a script inside of ServerScriptService without manually typing in: game.Workspace.Gate.Model.Model.Part1.WeldConstraint:Destroy()
Essentially, looping through all the children of the Model, and checking if they have a WeldConstraint and if so deleting it.
This is the current script inside of ServerScriptService:
local gateModel = game.Workspace.Gate.Model
local rockModelPrimaryPart = gateModel.PrimaryPart
function destroyWelds()
-- destroy welds here
end
wait (5)
destroyWelds()
local gateModel = game.Workspace.Gate.Model
local rockModelPrimaryPart = gateModel.PrimaryPart
function destroyWelds()
-- destroy welds here
for _,v in ipairs(gateModel:GetDescendants()) do
if v:IsA("WeldConstraint") then
v:Destroy()
end
end
end
wait (5)
destroyWelds()