Hello, so i have this script that supposed to change a player sword position from the torso to the right arm
local Sword = game.ReplicatedStorage.CombatStorage.Sword:Clone()
Sword.Parent = Character
Sword.WeldConstraint.Part1 = Character.Torso
Sword.Orientation = Character.Torso.Orientation + Vector3.new(180, 0, 180)
Sword.Position = Character.Torso.Position + Vector3.new(-0.9,-1.1,0)
local Animator = Humanoid:FindFirstChildOfClass('Animator')
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
if SwordOut == false then
local TakeOut = Animator:LoadAnimation(script.CombatManager.RegularM1s.Animations.TakeOut):Play()
wait(0.5)
CanSlash.Value = true
Sword.WeldConstraint.Part1 = Character["Right Arm"]
Sword.Orientation = Character["Right Arm"].Orientation
local RightPos = Character["Right Arm"].Position
Sword.CFrame = CFrame.new(RightPos * Vector3.new(1,-0.5,-1))
SwordOut = true
elseif SwordOut == true then
CanSlash.Value = false
SwordOut = false
end
end
end)
But when i press E this happens