So the Scripts i have, That makes it so the Sword appears the on players back, and they can Draw their sword, Which makes the sword appear in the players hand, but just straight up into their arm, How do i fix this? Im using the qPerfection Weld Script and 2 others.
QPerfection Weld: You can search it on the toolbox menu.
Weld:
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) local weldpart = game:GetService("ReplicatedStorage").Sword:Clone() weldpart.Parent = char local weld = Instance.new("Weld",weldpart.BackWeld) weld.Part0 = char.UpperTorso weld.Part1 = weldpart.BackWeld end) end)
WeldAfter:
game.ReplicatedStorage:WaitForChild("EquipEvent").OnServerEvent:Connect(function(player,Equipped) local holdanim = Instance.new("Animation") holdanim.AnimationId = game:GetService("ReplicatedStorage"):WaitForChild("SwordConfiguration").Hold.Value local holdanimtrack = player.Character.Humanoid:LoadAnimation(holdanim) if Equipped then print("Equipped") local anim = Instance.new("Animation") anim.AnimationId = game:GetService("ReplicatedStorage"):WaitForChild("SwordConfiguration").Equip.Value local animtrack = player.Character.Humanoid:LoadAnimation(anim) animtrack:Play() wait(.480) player.Character.Sword.Sword.Unsheath:Play() player.Character.Sword.BackWeld.Weld:Destroy() local newWeld = Instance.new("Weld",player.Character.Sword.Handle) newWeld.Part0 = player.Character.Sword.Handle newWeld.Part1 = player.Character.RightHand wait(.3) animtrack:Stop() anim:Destroy() holdanimtrack:Play() elseif not Equipped then print("UnEquipped") holdanimtrack:Stop() local anim = Instance.new("Animation") anim.AnimationId = game:GetService("ReplicatedStorage"):WaitForChild("SwordConfiguration").UnEquip.Value local animtrack = player.Character.Humanoid:LoadAnimation(anim) animtrack:Play() wait(.418) player.Character.Sword.Sword.Sheath:Play() wait(0.062) player.Character.Sword.Handle.Weld:Destroy() local newWeld = Instance.new("Weld",player.Character.Sword.BackWeld) newWeld.Part0 = player.Character.Sword.BackWeld newWeld.Part1 = player.Character.UpperTorso wait(.3) animtrack:Stop() anim:Destroy() end end)
Also, The Animations in the Settings folder of the script that runs the sword, Whenever you equip / unequip or click, It doesn't play the animation! Please help!
Here's the weld function I linked in the comments:
local function createWeld(part0, part1, weldType, offset) local weld = Instance.new(weldType or "Weld") offset = offset or CFrame.new() weld.Part0 = part0 weld.Part1 = part1 weld.C0 = part0.CFrame:inverse() * part1.CFrame * offset weld.Parent = part0 return weld end
To put the sword onto the player's hand, we'd want to rotate the sword so it's in front of the player and then weld it. How you rotate it depends on how the handle is rotated by the way.
Visual of how we're rotating it: https://i.imgur.com/mz9dFco.png
--position sword to hand sword.Handle.CFrame = player.Character.RightHand.CFrame * CFrame.Angles(math.rad(-90),0,0) * CFrame.new(0,0,-player.Character.RightHand.Size.Y/2) * CFrame.Angles(0,math.rad(90),0) --create the new weld using function above local weld = createWeld(sword.BackWeld, player.Character.RightHand)