So I’m trying to set the part ownership to the player if the weld gets destroyed but the part still floats in the air.
Client:
local function breakWeldConstraint(part, otherPart)
for i,v in ipairs(part:GetChildren()) do
if v:IsA("WeldConstraint") then
v:Destroy()
end
end
for i,v in ipairs(otherPart:GetChildren()) do
if v:IsA("WeldConstraint") and v.Part1 == part then
v:Destroy()
end
end
script.SetNetworkOwner:FireServer(part)
script.SetNetworkOwner:FireServer(otherPart)
end
for i,v in ipairs(Parts:GetChildren()) do
if v:IsA("BasePart") then
v.Touched:Connect(function(hit)
breakWeldConstraint(v, hit)
end)
end
end
Server:
script.Parent.SetNetworkOwner.OnServerEvent:Connect(function(player, part)
if part then
part:SetNetworkOwner(player)
end
end)