fire.OnServerEvent:Connect(function(k,l)local E=k.Character local D=E:FindFirstChild("\072\117\109\097\110\111\105\100")local v=Vector3.new(math.random(-accuracy.Value*2,accuracy.Value*2),math.random(-accuracy.Value*2,accuracy.Value*2),math.random(-accuracy.Value*2,accuracy.Value*2))if D and D~=0 then local g=Instance.new("\080\097\114\116",workspace)local o=Instance.new("\084\114\097\105\108",g)o.FaceCamera=true o.Lifetime=.3 o.MinLength=.15 o.LightEmission=.25 local m=Instance.new("\065\116\116\097\099\104\109\101\110\116",g)m.Position=Vector3.new(.35,0,0)m.Name="\065\116\116\097\099\104\109\101\110\116\049"local s=Instance.new("\065\116\116\097\099\104\109\101\110\116",g)s.Position=Vector3.new(-0.35,0,0)s.Name="\065\116\116\097\099\104\109\101\110\116\049"o.Attachment0=m o.Attachment1=s g.Name="\066\117\108\108\101\116"g.BrickColor=BrickColor.new("\083\109\111\107\121 \103\114\097\121")g.Shape="\066\097\108\108"g.Material=Enum.Material.Metal g.TopSurface=0 g.BottomSurface=0 g.Size=Vector3.new(1,1,1)g.Transparency=1 g.CFrame=CFrame.new(muzzle.CFrame.p,l.p)g.CanCollide=false local b={}local Q=Color3.new(255,255,0)local z=Color3.new(213,115,61)table.insert(b,NumberSequenceKeypoint.new(0,1))table.insert(b,NumberSequenceKeypoint.new(.25,0))table.insert(b,NumberSequenceKeypoint.new(1,1))local j=NumberSequence.new(b)local r=ColorSequence.new(Q,z)o.Transparency=j o.Color=r local c=Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121",g)c.MaxForce=Vector3.new(9000000000.0,9000000000.0,9000000000.0)c.Velocity=l.lookVector*velocity.Value+v debris:AddItem(g,20)g.Touched:Connect(function(l)local v=l.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")or l.Parent.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")local o=math.random(minDamage.Value,maxDamage.Value)if not v and(not l.Anchored and not l:IsDescendantOf(E))then g:Destroy()elseif v and(v~=D and(v.Health>0 and l~=g))then if l.Name=="\072\101\097\100"or l:IsA("\072\097\116")then o=o*1.5 end local E=maxDamage.Value DamageAndTagHumanoid(k,v,o)if showDamageText then DynamicText(o,E,v)else end g:Destroy()elseif l.CanCollide==true and(not l:IsDescendantOf(k.Character)and l.Anchored==true)then g:Destroy()end end)handle.Fire:Play()muzzleEffect.Visible=true muzzleEffect.Rotation=math.random(-360,360)delay(.1,function()muzzleEffect.Visible=false end)end end)activateSpecial.OnServerEvent:Connect(function(k)accuracy.Value,fireRate.Value=accuracy.Value/2,fireRate.Value/2 minDamage.Value,maxDamage.Value=minDamage.Value/2,maxDamage.Value/2 spawn(function()local l=Instance.new("\083\111\117\110\100",k.PlayerGui)l.Name="\067\104\097\114\103\101\083\111\117\110\100"l.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047\049\054\051\054\049\057\056\052\057"l:Play()l.Ended:Connect(function()l:Destroy()end)local E=Instance.new("\083\112\097\114\107\108\101\115",handle)E.SparkleColor=Color3.fromRGB(248,248,248)local D=Instance.new("\083\099\114\101\101\110\071\117\105",k.PlayerGui)D.Name="\083\112\101\099\105\097\108\065\099\116\105\118\097\116\101\100"local v=Instance.new("\084\101\120\116\076\097\098\101\108",D)v.TextColor3=Color3.fromRGB(0,180,30)v.Text="\067\072\065\079\083 \077\079\068\069"v.Font=Enum.Font.SourceSans v.TextScaled=true v.TextStrokeTransparency=0 v.Size=UDim2.new(0,300,0,50)v.Position=UDim2.new(2.5,0,.15,-10)v.BackgroundTransparency=1 v:TweenPosition(UDim2.new(.5,-(v.Size.X.Offset/2),.1,-10),Enum.EasingDirection.Out,Enum.EasingStyle.Back,1)debris:AddItem(E,specialDuration.Value)debris:AddItem(l,3)wait(3)TextEffects(v,200,Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,1)end)for k=specialDuration.Value,0,-1 do wait(1)print("\083\112\101\099\105\097\108 \097\099\116\105\118\097\116\101\100\058 "..k)end accuracy.Value,fireRate.Value=accuracy.Value*2,fireRate.Value*2 minDamage.Value,maxDamage.Value=minDamage.Value*2,maxDamage.Value*2 activateSpecial:FireClient(k)end)

fire.OnServerEvent:Connect(function(player, mouseHit)
	local character = player.Character
	local humanoid = character:FindFirstChild("Humanoid")
	local weaponAccuracy = Vector3.new(math.random(-accuracy.Value * 2, accuracy.Value * 2), math.random(-accuracy.Value * 2, accuracy.Value * 2), math.random(-accuracy.Value * 2, accuracy.Value * 2))
	
	if humanoid and humanoid ~= 0 then
		local projectile = Instance.new("Part", workspace)
		
			local trail = Instance.new("Trail", projectile)
			trail.FaceCamera = true
			trail.Lifetime = 0.3
			trail.MinLength = 0.15	
			trail.LightEmission = 0.25
						
			local attachment0 = Instance.new("Attachment", projectile)
			attachment0.Position = Vector3.new(0.35, 0, 0)
			attachment0.Name = "Attachment1"
			local attachment1 = Instance.new("Attachment", projectile)
			attachment1.Position = Vector3.new(-0.35, 0, 0)
			attachment1.Name = "Attachment1"
			
			trail.Attachment0 = attachment0
			trail.Attachment1 = attachment1
			
		projectile.Name = "Bullet"
		projectile.BrickColor = BrickColor.new("Smoky gray")
		projectile.Shape = "Ball"
		projectile.Material = Enum.Material.Metal
		projectile.TopSurface = 0
		projectile.BottomSurface = 0
		projectile.Size = Vector3.new(1, 1, 1)	
		projectile.Transparency = 1
		projectile.CFrame = CFrame.new(muzzle.CFrame.p, mouseHit.p)
		projectile.CanCollide = false

			local transparencyPoints = {}
			local startColor = Color3.new(255, 255, 0)
			local endColor = Color3.new(213, 115, 61)
			
			table.insert(transparencyPoints, NumberSequenceKeypoint.new(0, 1))
			table.insert(transparencyPoints, NumberSequenceKeypoint.new(0.25, 0))
			table.insert(transparencyPoints, NumberSequenceKeypoint.new(1, 1))
			
			local determinedTransparency = NumberSequence.new(transparencyPoints)
			local determinedColors = ColorSequence.new(startColor, endColor)
			
			trail.Transparency = determinedTransparency
			trail.Color = determinedColors
		
			local bodyVelocity = Instance.new("BodyVelocity", projectile)
			bodyVelocity.MaxForce = Vector3.new(9e9, 9e9, 9e9)
			bodyVelocity.Velocity = (mouseHit.lookVector * velocity.Value) + weaponAccuracy
			
		debris:AddItem(projectile, 20)
		
		projectile.Touched:Connect(function(hit)
			local eHumanoid = hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid")
			local damage = math.random(minDamage.Value, maxDamage.Value)
			if not eHumanoid and not hit.Anchored and not hit:IsDescendantOf(character) then
				
				projectile:Destroy()
			elseif eHumanoid and eHumanoid ~= humanoid and eHumanoid.Health > 0 and hit ~= projectile then
				
				if hit.Name == "Head" or hit:IsA("Hat") then
					damage = damage * 1.5
				end
				
				local criticalPoint = maxDamage.Value
				DamageAndTagHumanoid(player, eHumanoid, damage) 
				
				if showDamageText then
					DynamicText(damage, criticalPoint, eHumanoid)
				else
				end
				
				projectile:Destroy()
			elseif hit.CanCollide == true and not hit:IsDescendantOf(player.Character) and hit.Anchored == true then
		
				projectile:Destroy()
			end
		end)
		
		handle.Fire:Play()
		muzzleEffect.Visible = true
		muzzleEffect.Rotation = math.random(-360, 360)
		
		delay(0.1, function()
			muzzleEffect.Visible = false
		end)
		
	end
end)

activateSpecial.OnServerEvent:Connect(function(player)
	accuracy.Value, fireRate.Value = accuracy.Value / 2, fireRate.Value / 2
	minDamage.Value, maxDamage.Value = minDamage.Value / 2, maxDamage.Value / 2
	
	spawn(function()
		local chargeSound = Instance.new("Sound", player.PlayerGui)
		chargeSound.Name = "ChargeSound"
		chargeSound.SoundId = "rbxassetid://163619849"
		chargeSound:Play()
		
		chargeSound.Ended:Connect(function() chargeSound:Destroy() end)
		
		local sparkles = Instance.new("Sparkles", handle)
		sparkles.SparkleColor = Color3.fromRGB(248, 248, 248)
		
		local activatedGui = Instance.new("ScreenGui", player.PlayerGui)
		activatedGui.Name = "SpecialActivated"
			local textLabel = Instance.new("TextLabel", activatedGui) 
			textLabel.TextColor3 = Color3.fromRGB(0, 180, 30)
			textLabel.Text = "CHAOS MODE"
			textLabel.Font = Enum.Font.SourceSans
			textLabel.TextScaled = true
			textLabel.TextStrokeTransparency = 0
			textLabel.Size = UDim2.new(0, 300, 0, 50) 
			textLabel.Position = UDim2.new(2.5, 0, 0.15, -10) 
			textLabel.BackgroundTransparency = 1
			textLabel:TweenPosition(UDim2.new(0.5, -(textLabel.Size.X.Offset / 2),  0.1, -10), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 1)
		
		debris:AddItem(sparkles, specialDuration.Value)
		debris:AddItem(chargeSound, 3)
		
		wait(3)
		TextEffects(textLabel, 200, Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1)
	end)
	
	for i = specialDuration.Value, 0, -1 do
		wait(1)
		print("Special activated: "..i)
	end
	
	accuracy.Value, fireRate.Value = accuracy.Value * 2, fireRate.Value * 2
	minDamage.Value, maxDamage.Value = minDamage.Value * 2, maxDamage.Value * 2
	activateSpecial:FireClient(player)
end)
