local death = false
script.Parent.Touched:Connect(function(hit)
if death == false then
local plr = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if plr then
local org = game.ReplicatedStorage["Real Knife"]
local rk = org:Clone()
local handle = rk.Part
rk.Parent = workspace
local att = Instance.new("Motor6D")
att.Parent = plr.Character.RightHand
att.Part0 = plr.Character.RightHand
att.Part1 = handle
death = true
end
end
end)
Then I guess in order to rotate and move it you could use CFrame and CFrame.Angles.
Here is a recent script of mine:
if EquipType == "MainHand" or EquipType == "SecondaryHand" then
local tool = game.ServerStorage.Tools:FindFirstChild(ItemName):Clone()
tool.Parent = Player.Backpack
local ToolAttachment = tool.AestheticPart.PartAttachment
local Motor = Instance.new("Motor6D", tool)
Motor.Part1 = tool.AestheticPart
Motor.Part0 = Player.Character.RightHand
Motor.C1 = ToolAttachment.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, 0)
end
Note: I used CFrame.fromEulerAngles because I wanted to, it’s the same as CFrame.Angles
I usually just add WeldConstraints to all of the parts in the model, and connect each of them to the PrimaryPart (you can do this in a script a lot easier).
Then I just weld the PrimaryPart to the Character, and Walah, you’ve got yourself a solution.
I call this one the no-code accessory method. It uses the underappreciated accessories and the amazing attachment setup already found in Humanoids. All you need to do is call AddAccessory on the knife after cloning it. As for welding, do it in Studio with WeldConstraints, don’t write code for it.
There’s of course many ways to make pseudotools, as in attaching models to arms instead of using tools. I’m a big fan of it and do it a lot. I’ll just be showing you the easy and quick way without much thought behind it. Note that this works for left-handed tools as well.
This is purely a picture tutorial, as they are self explanatory. Please do ask if you have questions.
In my mini-tutorial, I don’t clone attachments. I made a completely new attachment on the accessory’s handle and positioned it on the handle of the mesh. You can see this from how I circle the front and right axis on both the rig’s RightGripAttachment and the sword’s attachment.
AddAccessory automatically aligns attachments of the same name. You’ll notice that I rotated the attachment on the sword so when I use AddAccessory, the axis would line up.
If you wanted to make my specific tool left-handed, all you’d need to do is change the name of the attachment in the sword handle to LeftGripAttachment.
Tool Grip Editor is only for changing the grip of a tool instance on equip. It doesn’t add tools to hands as OP requested as they’re using a custom tool solution here.
I want to attach an accessory to a hand of a R6 character, but the problem is R6 models doesnt have attachments on hands.
Is there a way to still add an accessory on hand without attachment?
Thank you!
Where are you getting your test dummies from? R6 characters have hand attachments added natively. You may not be working with an updated model. It’s best to reference an actual character that’s constructed in a live game rather than something generated or retrieved from another source.
Oh thank you so much for informing me. I am using R6 dummies from toolbox. I added some other R6 dummies from toolbox and they also didnt had any attachments on arms, so that made me believe that there arent any attachments on arms.
This would be a problem with your implementation. Please supply details about your current attempt. I can’t help you if all I have is this message to work from. Whenever something doesn’t work, you should always strive to provide as much about the circumstances as possible.
Could you supply other information about this? I still don’t have enough to work off of.
What is the hierarchy of the model?
How do you attach this to the player? What’s the code you’re using?
Can you confirm that a matching attachment for the handle exists in the character?
I’ve provided a small repro so you can check if what you’re doing matches exactly with the tutorial or my given implementation. Following through is important, including with naming choices.