The sword named Nichirin, here the code:
local module = {} function foundkatanatool(char) wait(.1) local tool = char:FindFirstChildWhichIsA("Tool") if tool then local typ = tool:FindFirstChild("Type") if typ and typ.ClassName == "StringValue" and typ.Value == "Sword" then return true end end end module.EquipNichirin = function(character) local model = character:FindFirstChild("SwordModel") if model and model:IsA("Model") and character:FindFirstChild("Humanoid") then local anim = character.Humanoid:LoadAnimation(script.Idle) anim:Play() if character.EquippedKatana.Value == false then character.HumanoidRootPart.UnSheathe:Play() local unsheatheanim = character.Humanoid:LoadAnimation(script.UnSheathe) unsheatheanim:Play() unsheatheanim:AdjustSpeed(.5) end character.EquippedKatana.Value = true local weld = model.Handle:FindFirstChild("HandleWeld") if weld then weld.Part0 = character:FindFirstChild("Right Arm") weld.C0 = CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(270),math.rad(180),math.rad(90)) * CFrame.Angles(0, math.rad(90), 0) end end end module.UnequipNichirin = function(character) local model = character:FindFirstChild("SwordModel") if model and model:IsA("Model") and not foundkatanatool(character) and character:FindFirstChild("Humanoid") then local anim = character.Humanoid:LoadAnimation(script.Idle) anim:Stop() local anim = character.Humanoid:LoadAnimation(script.Sheathe) anim:Play() anim:AdjustSpeed(.8) character.EquippedKatana.Value = false local weld = model.Handle:FindFirstChild("HandleWeld") if weld then delay(.12,function() if not foundkatanatool(character) then weld.Part0 = character:WaitForChild("Torso") weld.C0 = CFrame.new(-1, -.1, -1.2) * CFrame.Angles(math.rad(200),math.rad(180),math.rad(90)) end end) end end end
I would just do this (Btw add a animation Inside of tool):
local tool = script.Parent local animation = tool.Animation local AnimationTrack tool.Equipped:Connect(function() local Char = tool.Parent local Humanoid = Char.Humanoid AnimationTrack = Humanoid:LoadAnimation(animation) AnimationTrack:Play() end) tool.Unequipped:Connect(function() AnimationTrack:Stop() end)