Help with weld constraint

Hi! I need help setting a weld constraint part1 to nil. I have a script that changes part 1 to nil and when I add a print function in the script it prints as part 1 being nil, when really it is not.

Server Script:

    local playerConstraint = LuckyBlock.Main.PlayerConstraint
	playerConstraint.Part1 = nil
	print(playerConstraint.Part1)
	for i, v in pairs(LuckyBlock:GetChildren()) do
		if v:IsA("MeshPart") then
			v.CFrame = script.Parent.Holder.CFrame
			v.Anchored = true
		end
	end

There are no errors in the output

Is the script a local script…?

No it is a server script. It gets called on a remote event

Another question, are the MeshParts in the for loop anchored when the event is fired?

No they are not anchored. Will anchoring fix it?

If they don’t get anchored, then something is preventing the script to get to that code. Can you show us the full script?

Wait I might have responded wrong. When the remote event fires it does get to the part where it anchored the blocks but the code is:

local UIS = game:GetService("UserInputService")
local main = script.Parent.Main
local RepStore = game:GetService("ReplicatedStorage")

local onPc = script.Parent.OpenerGui.OpenerButton:GetAttribute("OnPcValue")
local processed = script.Parent.OpenerGui.OpenerButton:GetAttribute("Processed")

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
	    if (UIS.KeyboardEnabled) then
		    print("Player Has Keyboard")
		    script.Parent.OpenerGui.OpenerButton:SetAttribute("OnPcValue", true)
		    script.Parent.OpenerGui.Parent = game.StarterGui
		    script.Parent.RemoteHandler:FireClient(player, script.Parent)
		    print("Fired")
	    else
		    script.Parent.OpenerGui.OpenerButton:SetAttribute("OnPcValue", false)
		    script.Parent.OpenerGui.Parent = game.StarterGui
		    script.Parent.RemoteHandler:FireClient(player, script.Parent)
		    print("Fired")
	    end
	    script.Parent.RemoteHandler.OnServerEvent:Connect(function(player)
		local hrp = char.HumanoidRootPart
		local LuckyBlock = char:WaitForChild("LuckyBlock")
		local opened = LuckyBlock:GetAttribute("Opened")
		local equipped = LuckyBlock:GetAttribute("Equipped")
		local playerConstraint = LuckyBlock.Main.PlayerConstraint
		
		playerConstraint.Part1 = nil
		print(playerConstraint.Part1)
		for i, v in pairs(LuckyBlock:GetChildren()) do
			if v:IsA("MeshPart") then
				v.CFrame = script.Parent.Holder.CFrame
				v.Anchored = true
			end
		end
	end)
end)
end)

Not sure why is this happening. Are ALL the other lines of code work, except of the one with setting the Part1 to nil?

I’m pretty sure, I do not get any errors.

Can you try printing both the Part properties and the instance of playerConstraint? What’s the output?

I found out that the meshpart needed to be anchored before changing the weld constraint properties from a reply you said. Thanks for the help!