How do I weld a sword case to the player's side?

After local testing, try locating where the sheath is in the explorer. If it’s inside of the player’s character, then it’s a position issue.

Yeah Im a bit new to scripting so a lua example would be good

I’m not sure if its inside the character Heres the output
ereee

local HumanoidRootPart = Character.HumanoidRootPart
local hrpOrigin = HumanoidRootPart.CFrame

local calculatedCFrame = CFrame.new(hrpOrigin + Vector3.new(-HumanoidRootPart.Size.X, HumanoidRootPart.Size.Y, 0))

-- if it's a model, set the primary part to the case's base.
case:SetPrimaryPartCFrame(calculatedCFrame))

local Weld = Instance.new("WeldConstraint")
-- you don't have to change the C0. matter of fact, I don't think it's even an existing property for WeldConstraint.
Weld.Part0 = Character.HumanoidRootPart
Weld.Part1 = case
Weld.Parent = case

And like I said, you should make the base of the sheath the primary part of the model. If you don’t know how to do that, select the model, click on primary part, then find the part that you want to be the primary part.

You can use accessories. Put your case in the accessory and call it Handle, make an attachment inside the Handle and name it based on what attachment you want it to stick to on someone’s character, and then use the move tool (not the attachment’s move tool it’s quite broken)!

Also, to get a dummy to edit on, look up in the toolbox, “Attachment dummy your rig type.”

Edit: welding and motor6Ds are NOT the way to go at all.

1 Like

sword weld example.rbxl (41.2 KB)
Try this. I added a sword and you can replace it with literally anything.

Does it work with models with two parts?

Can i have the model for the sheath so i can weld it and give code?

hmm Im not gett
dont see.PNG
ing an error but I dont see it on my character /:

Yeah sure one sec I got to make it a download

wait how do I give you a rbx file for it again?

Shieth.rbxl (56.1 KB)
sorry it took so long i had to figure out how to download as rbxm

1 Like

Uh did you read what I said up there? It seriously works I use accessors for armor in my game

Ok I’ll try your method right now

1 Like

Sheath weld for devforum.rbxl (55.7 KB)
Fixed it

However, i mean accessories are a more hacky way, but i dont recommend them because sometimes they can be stuck to the center of the hrp (humanoidrootpart)

It worked but is there a way for it to go into a serverscript? I’m following a sword tutorial and thats how he welded it.

It works in a ServerScript too. They’re the same code, but in a serverscript instead of LocalScripts.

Got It. I’m gonna test it out in a serverscript. Thanks for helping me out it really helped.

Glad to help you out! Have a nice day!