How To Put Items On A Player's Back? (Like a Sword)

Thanks, I’ll make sure to try it out

You want it to still be welded when it is equipped again?? Or on their back

No, I mean like when it’s not equipped, it’s welded to the player’s back but when it is equipped would it stop welding? Because if it keeps welding it would be stuck and the player wouldn’t be able to attack. Or would I have to make it so that it unwelds when it’s equipped?

you will need to weld it to there back when they equip the item. and then destroy it when they unequip the item.

it can be done by clonning the item then welding the clone onto there backs, then destroying the clone from the back.

Yes you would have to destroy the weld, if you want it on the players back when equipped you should or where ever you want to place the tool use a tool grip editor such as this one : Tool Grip Editor - Roblox

So it’s only welded to their back when it’s unequipped, but when it is equipped I destroy the weld. How would do that cloning thing? do I do like

Tool = script.Parent

if Tool.Equipped == true then -- Or maybe Tool.Equipped:Connect(function() ?
Tool:Clone()
Tool.Handle.Weld:Destroy()

and if that’s correct what would I do from there? I’m not too familiar with cloning. I’m a rookie at coding

Alright I’ll try it, also would this make the tool visible to other players even when it’s unequipped?

If it’s a normal script

Tool.Equipped:Connect(function()
character = Tool.Parent
Tool.Unequipped:Connect(function()
-- make an attachment on the back of the torso or humanoid root part and parent it to the torso or root part.
-- clone the handle then put it in the character : NewHandle.Parent = character
-- then weld the new handle first and with the torso or root part second and for C0 use the cframe of the attachment.
      end)
end)

I’m a little confused now.
So how do I make the attachment? Do I do instance.new or do I create it in workspace?
And how would I attach it to the player’s back?

character.Torso.Position?

And when I clone the handle

 Tool.Hande:Clone() 

Do I change the name to NewHandle?

You do Instance.new and you can name whatever you want I just put that so you could know it is the new one. I would first try out where exactly you want it on the dummy before making it.

I tried it on the dummy so now I know exactly where I want to put it. But how do I put it on the player’s back?

Grip editing won’t give you the best results if the tool is supposed to be anywhere but the player’s hand. You should be attaching models to players independent of the tool other than the equip events.

My personal favourite method for attaching items to players is to use accessories and the attachment setup already found in players. You can use the method below to find out how you can attach things to players (in your case though, instead of RightGripAttachment, you’d be using BodyBackAttachment):

I made a semi-related post to a thread which involves attaching items on the player’s back and switching them to the hand to be held. You can follow the first part of the post which involves attaching items to the player’s back:

Naturally with this method you’d have to change around some of your code if you want to modify the bag or anything - that meaning you’d be accessing the accessory to apply your changes instead of the tool. Not too big of a switcharoo though, still manageable.

4 Likes
Tool.Equipped:Connect(function()
character = Tool.Parent
end)

Tool.Unequipped:Connect(function()
local Attach = Instance.new("Attachment")
Attach.Parent = -- Character:WaitForChild("torso or humanoid root part") 
Attach.Position = Vector3.new(-- where you chose it)
-- clone the handle and parent it
local Weld = Instance.new("Weld")
Weld.Parent = -- the new handle
Weld.Part0 = -- the new handle
Weld.Par1 = -- Character:WaitForChild("torso or humanoid root part") 
Weld.C0 = CFrame.new(attach.CFrame)--  or just attach.CFrame
      end)

I feel obligated to mention that your code is going to cause a memory leak which will be bad for the server in the long run. Every time the player equips this tool, an Unequipped connection would be made. So in addition to several uncleaned connections, you’re adding more.

Always separate your connections. If you have a connection in another one, then ideally there should be some guarantee that it gets cleaned whether by engine processes or your own code.

Tool.Equipped:Connect(function ()
    character = Tool.parent
end)

Tool.Unequipped:Connect(function ()
    -- Weld here.
end)

So like this? But just to be safe that the attachment doesn’t go inside of the torso instead of on the back, how do I change the position of it? Like add or subtract the x or y value

Tool = script.Parent
Handle = Tool.Handle

Tool.Equipped:Connect(function()
	Tool.Equipped:Connect(function ()
		character = Tool.parent
	end)

	Tool.Unequipped:Connect(function ()
		local atchm = Instance.new("Attachment")
		local weld = Instance.new("WeldConstraint")
		atchm.Position = character.Torso.Position --Like maybe character.torso.position.x - 5
		weld.Part0 = atchm
		weld.Part1 = Handle
	end)
end)	

No, I didn’t mean putting both those connections inside another Equipped event, I meant making them standalone. Remove the outer Equipped event.

As for the positioning stuff, that’s where you get an attachment in the Handle that’s named the same as an attachment in the character. You can then use their respective attachment CFrames as your C0 and C1 so the positioning would be handled automatically. Check those threads for more information.

Just to reiterate what’s already on those threads: suppose I have a backpack accessory (or a model) and I want to attach it to the back. There’s an attachment in the UpperTorso (for R15) called BodyBackAttachment and I want the backpack to line up with it. So I create an attachment called BodyBackAttachment in the backpack’s handle, position it how I want them just put it in the character.

If you wanted to weld it yourself, then you’d need to follow this principle:

  • Create a Weld. Must be a weld, not a WeldConstraint, because we need C0 and C1.
  • Part0 should be the root of the model (or in an accessory’s case, its Handle).
  • Part1 should be the limb you’re attaching to. It’s UpperTorso here.
  • C0 should be the CFrame of the attachment in Part0.
  • C1 should be the CFrame of the attachment in Part1.

Relevant:

(but again; same principle, just different attachment names to achieve your desired effect)

So I made it again and kept getting errors, so I kept fixing it and now it has no errors but it’s not working, do you notice anything wrong with it? I also want the tool to be visible to everyone even when it’s unequipped.

Tool = script.Parent
Handle = Tool.Handle	
character = Tool.parent
local BackBodyAttachment = Instance.new("Attachment")
BackBodyAttachment.Parent = Handle
BackBodyAttachment.Name = "BackBodyAttachment"
BackBodyAttachment.Position = character.Parent.Character.Torso.Position
Tool.Equipped:Connect(function()
	Tool.Equipped:Connect(function ()
	end)

	Tool.Unequipped:Connect(function ()
		local weld = Instance.new("Weld")
		weld.Part0 = Handle
		weld.Part1  = character.Parent.Character.Torso
		weld.C0 = weld.Part0.CFrame
		weld.C1 = weld.Part1.CFrame
	end)
end)

Please check my replies thoroughly. If you’re following through with my methods, then you need to read the posts as well and not skim them. There are still a lot of mistakes present.

  • BodyBackAttachment will already exist in R6 and R15 rigs, your script should not be creating them.

  • Your Equipped and Unequipped connections are still wrapped in an outer Equipped event.

  • Character should still be in the inner Equipped event, don’t move it out.

  • The Weld C0 and C1 are meant to be the CFrame of the attachments in either Part0 and Part1, not the CFrames of the parts themselves.

  • I thought you said to put an attachment in the handle that’s named the same thing as the attachment in the character’s torso, (BodyBackAttachment) so they can align with each other

  • I don’t know what that means. You mean because all the welding and stuff is done after it’s unequipped?

  • K I’ll put it back

  • So I do I do this?

        weld.Part0 = Handle
		weld.Part1  = character.Parent.Character.Torso
		weld.C0 = Handle.CFrame
		weld.C1 = character.Parent.Character.Torso.CFrame

quite easy ngl, just use Motor6d and determine the cframe on how you want it to weld on the back.

local motor6d = Instance.new("Motor6D")
motor6d.Parent = target
motor6d.Part1 = character.Parent.Character.Torso
motor6d.Part0 = Handle
motor6d.C0 = CFrame.new(0,0, -2) -- -2 here determine the z CFrame, set it up yourself in studio on how you want it to weld. you can also use the X, Y if you want it move and settle better. good luck
motor6d.C1 = CFrame.new(0,0,0)
7 Likes