Problems welding sword case

so i was made a sword case, and a part and welded the 2 parts together, the script bellow, I was trying to weld the model of the two parts above to the players torso, not sure why it doesn’t work, specifically the Torso part

game.Players.PlayerAdded:Connect(function(Player)
	local rs = game:GetService("ReplicatedStorage")
	local Equip = rs:WaitForChild("SwordEquip")
	local Character = Player.Character
	Equip.OnServerEvent:Connect(function(Player)
			local part = rs:WaitForChild("SwordCaseComplete")
			local partA = part:Clone()
			print("this even work?2")
		    local partB = Character:WaitForChild("Torso")
			partA.Position = partB.Position
			partA.Parent = Player.Character
			print("this even work3")
			local weld = Instance.new("WeldConstraint")
			weld.Part0 = partA
			weld.Part1 = partB
			weld.Parent = partA
	end)
end)

image

	local rs = game:GetService("ReplicatedStorage")
	local equip = rs:WaitForChild("SwordEquip")

	player.CharacterAdded:Connect(function(character)
		equip.OnServerEvent:Connect(function(player)
			local part = rs:WaitForChild("SwordCaseComplete")
			local partA = part:Clone()
			local partB = character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso") -- check r15

			if not partB then
				warn("Torso or UpperTorso not found!")
				return
			end

			partA.Parent = character
			partA.Position = partB.Position

			-- ensure both parts are parented before welding
			local weld = Instance.new("WeldConstraint")
			weld.Part0 = partA.PrimaryPart or partA:FindFirstChild("Basic_Handle") or partA
			weld.Part1 = partB
			weld.Parent = partA
		end)
	end)
end)
1 Like

hey bro thanks for the help, unfortunately I’m getting another error,


I understand the its a model so there isn’t any position property, I’m just confused on what to change it to

Try this

PrimaryPart.Position

make sure your model has the PrimaryPart set though.

everything worked except the actual sword being in the correct position, its welded and such, but why does the sword spawn far away?

image
its welded, it follows me whenever I move

When is it welded? when you join? or equip it.

When i equip it through a remote event

are you walking while equiping?

try moving far away, then stopping, then holding it check if its welding to your position.


i tested it while not moving and it doesn’t work still, basically its spawning in a set position and then welding, reason why there’s so many in the image is because I was changing my position before using equip

Most likely the middle of baseplate, could you show me the part of the script where the position, and welding are being done?

i think the script only responsible for welding the model to my torso,
I used some welds using a plugin to weld the sword to the part in my torso
image

You welded the sword to your torso using a plugin?

no i welded the sword to the part which I’m using to weld to the torso

Ah, alright, well try modding the script to set that humanoidrootpart looking basepart and make it like this

set the PrimaryPart to that humanoidrootpart looking basepart

model.PrimaryPart.CFrame = player.Character.HumanoidRootPart.CFrame

then weld it to the PrimaryPart and the players humanoidrootpart

2 Likes

I just wanted to let you know that you are the absolute goat.
thanks

2 Likes