local F=script.Parent damage=40 cooldown=.3 debris=game:GetService("\068\101\098\114\105\115")check=true function waitfor(F,u)while true do local A=F:FindFirstChild(u)if A~=nil then return A end wait()end end local u=waitfor(F,"\072\097\110\100\108\101")local A=game:GetService("\068\101\098\114\105\115")function randomcolor()if u then local F=u:FindFirstChild("\077\101\115\104")if F~=nil then F.VertexColor=Vector3.new(math.random(1,2),math.random(1,2),math.random(1,2))*.5 end end end function onButton1Down(l)if check then check=false l.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"local I=F.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")local H=F.Parent:FindFirstChild("\084\111\114\115\111")local i=F:FindFirstChild("\082\105\103\104\116\083\108\097\115\104")if i and(H and I)then theanim=I:LoadAnimation(i)theanim:Play(nil,nil,1.5)if theanim and I.Health>0 then local H=F.Handle:FindFirstChild("\083\108\097\115\104\083\111\117\110\100")if H then H:Play()end wait(.25)u.Transparency=1 local i=u:clone()i.Name="\069\102\102\101\099\116"i.CanCollide=false i.Transparency=1 i.Script.Disabled=false local o=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")o.Name="\099\114\101\097\116\111\114"o.Value=I o.Parent=i i.RotVelocity=Vector3.new(0,0,0)i.Velocity=(l.Hit.p-i.Position).unit*400+Vector3.new(0,0,0)i.CFrame=CFrame.new(u.Position,l.Hit.p)*CFrame.Angles(-math.pi/2,0,0)A:AddItem(i,20+math.random()*5)i.Parent=game.Workspace end end wait(cooldown-.25)l.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"randomcolor()u.Transparency=1 check=true end end F.Equipped:connect(function(F)if F==nil then print("\077\111\117\115\101 \110\111\116 \102\111\117\110\100")return end equipped=true F.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"F.Button1Down:connect(function()onButton1Down(F)end)end)F.Unequipped:connect(function()equipped=false u.Transparency=1 randomcolor()end)
--Made by Stickmasterluke

local sp = script.Parent

damage = 40
cooldown = 0.30

debris = game:GetService("Debris")
check = true

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

local handle = waitfor(sp, "Handle")
local debris = game:GetService("Debris")

function randomcolor()
	if handle then
		local m = handle:FindFirstChild("Mesh")
		if m ~= nil then
			m.VertexColor = Vector3.new(math.random(1, 2), math.random(1, 2), math.random(1, 2)) * 0.5
		end
	end
end

function onButton1Down(mouse)
	if check then
		check = false
		mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
		local h = sp.Parent:FindFirstChild("Humanoid")
		local t = sp.Parent:FindFirstChild("Torso")
		local anim = sp:FindFirstChild("RightSlash")
		if anim and t and h then
			theanim = h:LoadAnimation(anim)
			theanim:Play(nil, nil, 1.5)
			if theanim and h.Health > 0 then
				local sound = sp.Handle:FindFirstChild("SlashSound")
				if sound then
					sound:Play()
				end
				wait(0.25)
				handle.Transparency = 1
				local p = handle:clone()
				p.Name = "Effect"
				p.CanCollide = false
				p.Transparency = 1
				p.Script.Disabled = false
				local tag = Instance.new("ObjectValue")
				tag.Name = "creator"
				tag.Value = h
				tag.Parent = p
				p.RotVelocity = Vector3.new(0, 0, 0)
				p.Velocity = (mouse.Hit.p - p.Position).unit * 400 + Vector3.new(0, 0, 0)
				p.CFrame = CFrame.new(handle.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, 0, 0)
				debris:AddItem(p, 20 + math.random() * 5)
				p.Parent = game.Workspace
			end
		end
		wait(cooldown - 0.25)
		mouse.Icon = "rbxasset://textures\\GunCursor.png"
		randomcolor()
		handle.Transparency = 1
		check = true
	end
end

sp.Equipped:connect(function(mouse)
	if mouse == nil then
		print("Mouse not found")
		return
	end
	equipped = true
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	mouse.Button1Down:connect(function()
		onButton1Down(mouse)
	end)
end)

sp.Unequipped:connect(function()
	equipped = false
	handle.Transparency = 1
	randomcolor()
end)
