local S=script.Parent local z=10 local m=CFrame.Angles(math.pi/2,0,0)+Vector3.new(0,-0.25,-1.4)local r=m local Y=game:GetService("\068\101\098\114\105\115")local O=true local G=false local I=0 function waitfor(S,z)while true do local m=S:FindFirstChild(z)if m~=nil then return m end wait()end end waitfor(S,"\072\097\110\100\108\101")function onButton1Down(S)if not O then return end O=false S.Icon="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\092\071\117\110\087\097\105\116\067\117\114\115\111\114\046\112\110\103"wait(.75)S.Icon="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\092\071\117\110\067\117\114\115\111\114\046\112\110\103"O=true end function swordUp()r=m end function swordOut()r=m*CFrame.Angles(math.pi/4,.4,0)end function spinsword(z)delay(0,function()local m=tick()local Y=m+z while tick()<Y do S.Grip=r*CFrame.Angles((math.pi*2)*((tick()-m)/z),0,0)wait()end S.Grip=r end)end S.Equipped:connect(function(z)equipped=true local m=lastequipped if z==nil then print("\077\111\117\115\101 \110\111\116 \102\111\117\110\100")return end z.Icon="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\092\071\117\110\067\117\114\115\111\114\046\112\110\103"z.Button1Down:connect(function()onButton1Down(z)end)waitfor(S,"\084\097\117\110\116\105\110\103")waitfor(S,"\084\097\117\110\116")end)S.Unequipped:connect(function()equipped=false end)waitfor(S,"\082\117\110\065\110\105\109")S.RunAnim.Changed:connect(function()local z=S.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")local m=S.Parent:FindFirstChild("\084\111\114\115\111")local Y=S:FindFirstChild(S.RunAnim.Value)if Y and(m and z)then theanim=z:LoadAnimation(Y)if theanim and z.Health>0 then theanim:Play()if S.RunAnim.Value=="\082\105\103\104\116\083\108\097\115\104"or S.RunAnim.Value=="\076\101\102\116\083\108\097\115\104"or S.RunAnim.Value=="\079\118\101\114\072\101\097\100\083\119\105\110\103"then spinsword(.5)end if S.RunAnim.Value=="\079\118\101\114\072\101\097\100\083\119\105\110\103"then wait(.25)swordOut()wait(.5)swordUp()S.Grip=r elseif S.RunAnim.Value=="\079\118\101\114\072\101\097\100\083\119\105\110\103\070\097\115\116"then wait(.125)swordOut()wait(.25)swordUp()S.Grip=r end end end end)function tagHumanoid(S,z)for S,z in ipairs(S:GetChildren())do if z.Name=="\099\114\101\097\116\111\114"then z:remove()end end local m=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")m.Value=z m.Name="\099\114\101\097\116\111\114"m.Parent=S Y:AddItem(m,1)end
--Made by Stickmasterluke

local sp = script.Parent

local tauntcooldown = 10

local originalgrip = CFrame.Angles(math.pi / 2, 0, 0) + Vector3.new(0, -0.25, -1.4)

local currentgrip = originalgrip

local debris = game:GetService("Debris")
local enabled = true
local taunting = false
local lasttaunt = 0

function waitfor(parent, name)
	while true do
		local child = parent:FindFirstChild(name)
		if child ~= nil then
			return child
		end
		wait()
	end
end

waitfor(sp, "Handle")

function onButton1Down(mouse)
	if not enabled then
		return
	end
	enabled = false
	mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
	wait(0.75)
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	enabled = true
end

function swordUp()
	currentgrip = originalgrip
end

function swordOut()
	currentgrip = originalgrip * CFrame.Angles(math.pi / 4, 0.4, 0)
end

function spinsword(spintime)
	delay(0, function()
		local startspin = tick()
		local endspin = startspin + spintime
		while tick() < endspin do
			sp.Grip = currentgrip * CFrame.Angles(math.pi * 2 * ((tick() - startspin) / spintime), 0, 0)
			wait()
		end
		sp.Grip = currentgrip
	end)
end

sp.Equipped:connect(function(mouse)
	equipped = true
	local currentlast = lastequipped
	if mouse == nil then
		print("Mouse not found")
		return
	end
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	mouse.Button1Down:connect(function()
		onButton1Down(mouse)
	end)
	waitfor(sp, "Taunting")
	waitfor(sp, "Taunt")
	--[[waitfor(sp,"Summon")
	mouse.KeyDown:connect(function(key)
		key=string.lower(key)
		if key=="l" or key=="t" or key=="g" or key=="e" then
			local h=sp.Parent:FindFirstChild("Humanoid")
			if h~=nil and (not sp.Taunting.Value) and lasttaunt+tauntcooldown<tick() then
				lasttaunt=tick()
				sp.Taunting.Value=true
				h.WalkSpeed=0
				tauntanim=h:LoadAnimation(sp.Taunt)
				tauntanim:Play()
				wait(4)
				sp.Summon.Value=not sp.Summon.Value
				wait(1)
				h.WalkSpeed=16
				sp.Taunting.Value=false
			end
		end
	end)
	--]]
end)

sp.Unequipped:connect(function()
	equipped = false
end)

waitfor(sp, "RunAnim")
sp.RunAnim.Changed:connect(function()
	local h = sp.Parent:FindFirstChild("Humanoid")
	local t = sp.Parent:FindFirstChild("Torso")
	local anim = sp:FindFirstChild(sp.RunAnim.Value)
	if anim and t and h then
		theanim = h:LoadAnimation(anim)
		if theanim and h.Health > 0 then
			theanim:Play()
			if
				sp.RunAnim.Value == "RightSlash"
				or sp.RunAnim.Value == "LeftSlash"
				or sp.RunAnim.Value == "OverHeadSwing"
			then
				spinsword(0.5)
			end
			if sp.RunAnim.Value == "OverHeadSwing" then
				wait(0.25)
				swordOut()
				wait(0.5)
				swordUp()
				sp.Grip = currentgrip
			elseif sp.RunAnim.Value == "OverHeadSwingFast" then
				wait(0.125)
				swordOut()
				wait(0.25)
				swordUp()
				sp.Grip = currentgrip
			end
		end
	end
end)

function tagHumanoid(humanoid, player)
	for i, v in ipairs(humanoid:GetChildren()) do
		if v.Name == "creator" then
			v:remove()
		end
	end
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
	debris:AddItem(creator_tag, 1)
end
