Why does the weld.part0 reset after being parented to the player's character upon spawning?

I wrote a script trying to weld a weapon to my hand, set all it’s part1 and part0 accordingly to the right places:

local ServerStorage = game:GetService("ServerStorage")
game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local Mjolnir = ServerStorage.Mjolnir:Clone()
		Mjolnir.Position = Character.RightHand.Position
		
		local MjolnirWeld = ServerStorage.MjolnirWeld:Clone()
		MjolnirWeld.Part0 = Character.RightHand
		MjolnirWeld.Part1 = Mjolnir
		MjolnirWeld.Parent = Mjolnir
		
		Mjolnir.Parent = Character
	end)
end)

Even set the part0 and part1 of it’s original copy that is in the serverstorage to the right places in the explorer. However when I spawn in, the part0 of the weld is empty, resulting in the weld being non-functional. What in the world could be causing this issue, I’ve googled everywhere and no one seems to have encountered this stupid problem, posted a similar question on the forums( though it was less specific) and no one could provide a damn solution. The same code apparently works for other people but not for me. :roll_eyes:

You might as well try to isolate the problem, replace the tool with a normal part and send it to us with the relevant scripts included in a baseplate.

Currently your posts does not have enough information for us to work with. I figure something else is interfering from an outside script or maybe even a Roblox bug.

Edit: are you using R6 or R15 by any chance?

local ServerStorage = game:GetService("ServerStorage")
game.Players.PlayerAdded:Connect(function(Player)
local weldScript = script.Parent.(Script name)
	Player.CharacterAdded:Connect(function(Character)
		local Mjolnir = ServerStorage.Mjolnir:Clone()
		Mjolnir.Position = Character.RightHand.Position
		
		local MjolnirWeld = ServerStorage.MjolnirWeld:Clone()
		MjolnirWeld.Part0 = Character.RightHand
		MjolnirWeld.Part1 = Mjolnir
		MjolnirWeld.Parent = Mjolnir
		
		Mjolnir.Parent = Character
weldScript:Destroy()
	end)
end)

I’m using r15, but i’m not using a tool, just a singular part with a mesh inside it.

Uhm what is this supposed to be or do?

Alright new progression, I was using the classic male v2 arms before but after i switched to the default blocky arms, the code works now. Is there a way for it to work for the handy arms?

1 Like

How did you switch the arms? Avatar changes or via code?