Player = game.Players.LocalPlayer
Character = Player.Character
Mouse = Player:GetMouse()
run = game:GetService('RunService')
enabled = false
function Equip(key)
	if key == "q" and enabled == false then
		enabled = true
		script.Disabled = false
		for i = 1, 10 do
		RightShoulder = Character.Torso["Right Shoulder"]
		RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0 , 0, 0.16)
		end
		Part = Instance.new("Part")
		Part.Parent = Character
		Part.FormFactor = "Custom"
		Part.Size = Vector3.new(1.54, 0.2, 0.2)
		Part.BrickColor = BrickColor.new("Reddish brown")
		Part.TopSurface = "Smooth"
		Part.BottomSurface = "Smooth"
		Part.CanCollide = false
		Part.CFrame = CFrame.Angles(0, 0, 0)
		WeldSword = Instance.new("Part",Character)
		--------------------------- BREAKJOINTS!
		WeldSword:BreakJoints()
		Part:BreakJoints()
		-------------------------BREAKJOINTS!
		WeldSword.FormFactor = "Custom"
		WeldSword.Size = Vector3.new(4.48, 0.27, 0.73)
		WeldSword.BrickColor = BrickColor.new("Dark stone grey")
		WeldSword.CanCollide = false
		LD = script.Damage:Clone()
		LD.Parent = WeldSword
		WeldSword.TopSurface = "Smooth"
		WeldSword.BottomSurface = "Smooth"
		Weld = Instance.new("Weld",Character)
		Weld.Part0 = Weld.Parent["Right Arm"]
		Weld.Part1 = Part
		Weld.C1 = CFrame.Angles(0, 1.6, 0) *CFrame.new(0, 1, 0)
		Weld.C0 = CFrame.fromEulerAnglesXYZ(0, 0, 0)
		WeldSword1 = Instance.new("Weld",Character)
		WeldSword1.Part0 = Part
		WeldSword1.Part1 = WeldSword
		WeldSword1.C1 = CFrame.Angles(1.6, 3.1, 0) *CFrame.new(3, 0.25, -0.12)
		Character.Humanoid.WalkSpeed = 12
		
		
	end
end
function unEquip(k)
	if k == "e" then
		for i = 1, 10 do
		RightShoulder = Character.Torso["Right Shoulder"]
		RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0 , 0,-0.16)
		Part:Destroy()
		WeldSword:Destroy()
		Weld:Destroy()
		WeldSword1:Destroy()
		Character.Humanoid.WalkSpeed = 16
		end
	end
end
function Slash()
	for i = 1, 10 do
		RightShoulder.C0 = RightShoulder.C0 *CFrame.fromEulerAnglesXYZ(0, 0, -0.16)
		RightShoulder.C0 = RightShoulder.C0 *CFrame.fromEulerAnglesXYZ(0, 0.15, -0.16)
		
		run.Stepped:wait()
	end
	for i = 1, 10 do
		RightShoulder.C0 = RightShoulder.C0 *CFrame.fromEulerAnglesXYZ(0, 0, 0.16)
		RightShoulder.C0 = RightShoulder.C0 *CFrame.fromEulerAnglesXYZ(0, -0.15, 0.16)
		
		run.Stepped:wait()
	end
end
Mouse.KeyDown:connect(unEquip)
Mouse.Button1Down:connect(Slash)
Mouse.KeyDown:connect(Equip)

Problem is, after I unequip it by pressing "e". It does not work equipping or spawning the weapon again, any soloutions?

2 comments

0

That's not how SOS works...

1

this is the future chem, we need to embrace it