Alright so basically what I’m looking for is how to make it so that when you pick up a parachute pack, and when you equip it, you get the parachute and not the backpack. Also I’d like to know how I would make it so that when the player picks up the item, it stays on their back until they equip/use it.
So the two images are when the items are equipped, but not being used yet. When they’re not equipped it doesn’t do an animation.
Sorry for the bad explanation, I originally came here to figure out how to pick up a parachute pack, but get the actual parachute instead, kinda like if you pick up a backpack, but instead the tool is a notebook, but with parachutes. But I also wanted to know how to make an item stay on the player’s back when it’s not equipped, and do an animation when it is equipped. Usually the tools in your inventory are invisible until you use them, but I want to make them visible and stay on the player’s 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?
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
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?
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.
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.
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.
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
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.