Place tool on back when unequipped?

So, when my baseball bat tool is unequipped, I want it to be shown on the player’s back. This is the script I have so far, but it doesn’t do anything.

local tool = script.Parent
local char = tool.Parent.Parent.Character

tool.Unequipped:Connect(function()
	local tool2 = tool:Clone()
	tool2.animations:Destroy()
	tool2.BodyAttach:Destroy()
	tool2.Idle:Destroy()
	tool2.OnBack:Destroy()
	local weld = Instance.new("Weld")
	weld.Part0 = tool.Handle
	weld.Part1 = char.Torso
end)

I already understand that this script is far from complete, but I’m not sure what to do next. Any help is appreciated, thanks!

When it comes to coding, illusions can be your best friend.

You dont actually have to place the bat tool on your back, you can get an accessory and put a cloned version of the bat that is just a mesh called handle inside of an accessory and then place it in the character when that weapon is unequipped

1 Like

Thanks for the help! But I’m not quite sure how to do that :confused:

This is somewhat related to what you’re trying to achieve.

This almost works, but the bat is in the center of my character’s torso. Not sure how to reposition it to look natural.

Oh its super easy just create an empty accessory get a copy of your bat mesh and place it inside and call it Handle, then put a BackAccessoryAttachment inside of the Handle, then adjust it as needed, when your player unequips then just clone the Accessory you made and put it on the player’s character

1 Like
weld.C0 *= CFrame.new(0, 0, 0.8)
weld.C0 *= CFrame.new(0, 0, 0.9)

Change these lines. If you want to raise/lower the height then increase/decrease respectively the Y component of the CFrame.new call.

1 Like

If your game uses R6, you can make a part with the same size and position as the HumanoidRootPart then have the tool cloned and its parent set to the player with the CFrame and weld set up with it…

How do I rotate it, then?
char limit

Basically this would be the heirachy
image

Then just store the accessory somewhere inside of ReplicatedStorage, then clone it then parent it to the player

But keep in mind youll have to adjust the attachment to your liking

* CFrame.Angles(0, math.pi, 0)

By changing this part, math.pi represents a 180 degree rotation around the Y axis.

You could make a clone of the players Torso, and then weld the tool to the torso, then when the player unequips the tool clone the torso with the welded tool to the position of the players actual torso, then weld the fake torso to their torso.

Thanks everyone!!! There has been a lot of support but I think that I’ll use @dexanddeb’s method. So, I’ve got it to the point that when unequipped, it’s in the torso, but how, exactly, do I reposition it to look correct? Thanks.

2 Likes

Lets go!

Alright so basically you just gotta adjust the Attachment that you put into your bat’s handle!

They need assistance with the math.

1 Like

Not sure how to do that, like what does that mean

There is no need for math you can adjust the attachment of the accessory to position it accordingly

Make sure you heiarchy looks like this

You can grab the BodyBackAttachment from a dummy in the rigs tab

image

Yeah it does but like where do I look to adjust the attachment.

image

This is the math they’ll need assistance with, you’ll need to apply different adjustments based on the character’s rig type (R6 or R15), scale and package.

1 Like