Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Having trouble welding and positioning weld, any ideas?

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	if plr.CharacterAppearanceLoaded then
		local Clone = script.Parent:Clone()
		Clone.Parent = plr.Character
		Clone:ClearAllChildren()
		Clone.CFrame = plr.Character.Torso.CFrame

		local weld  = Instance.new("WeldConstraint")
		weld.Part0 = Clone
		weld.Part1 = plr.Character:WaitForChild("Torso")
		Clone.Anchored = false
		Clone.CanCollide = true
	end
end)

Here is my code, when I test the script there are zero errors but it does not work. Basically what the script does is positions the clone to the players torso.

1 answer

✓ Accepted answer

You forgot to parent the weld.

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	if plr.CharacterAppearanceLoaded then
		local Clone = script.Parent:Clone()
		Clone:ClearAllChildren()
		Clone.CFrame = plr.Character.Torso.CFrame
		Clone.Anchored = false
		Clone.CanCollide = true

		local weld  = Instance.new("WeldConstraint")
		weld.Part0 = Clone
		weld.Part1 = plr.Character:WaitForChild("Torso")
		weld.Parent = Clone
		
		Clone.Parent = plr.Character
	end
end)

1 comment

0

lol I see, thank you for the help

This discussion is preserved as it was. New answers, comments, and votes are closed.