function CreateGrenade()local t=Instance.new("\077\111\100\101\108")local E=Instance.new("\080\097\114\116")E.BrickColor=S.GrenadeColor E.Name="\067\101\110\116\101\114"E.CanCollide=false E.Elasticity=0 E.FormFactor=Enum.FormFactor.Custom E.Size=S.GrenadeSize E.BottomSurface=Enum.SurfaceType.Smooth E.TopSurface=Enum.SurfaceType.Smooth E.Parent=t local n=Instance.new("\083\112\101\099\105\097\108\077\101\115\104")n.MeshType=Enum.MeshType.Sphere n.Parent=E return t end function CreateKnife()local t=Instance.new("\080\097\114\116")t.BrickColor=S.GrenadeColor t.Name="\075\110\105\102\101"t.CanCollide=false t.FormFactor=Enum.FormFactor.Custom t.Size=VEC3(1,1,3)local E=Instance.new("\083\112\101\099\105\097\108\077\101\115\104")E.MeshId="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\049\050\050\050\049\055\050\048"E.MeshType=Enum.MeshType.FileMesh E.Scale=VEC3(.5,.5,.5)E.Parent=t return t end function CreateTarget()local t=Instance.new("\077\111\100\101\108")local E=Instance.new("\080\097\114\116")E.BrickColor=BrickColor.new("\066\114\105\103\104\116 \114\101\100")E.Material=Enum.Material.SmoothPlastic E.Transparency=.3 E.Name="\067\101\110\116\101\114"E.Anchored=true E.CanCollide=false E.FormFactor=Enum.FormFactor.Custom E.Size=VEC3(4,.2,4)E.Parent=t local n=Instance.new("\067\121\108\105\110\100\101\114\077\101\115\104")n.Parent=E local e=Instance.new("\080\097\114\116")e.BrickColor=BrickColor.new("\066\114\105\103\104\116 \114\101\100")e.Transparency=.3 e.Name="\076\105\110\101"e.CFrame=E.CFrame*CFrame.new(0,5.1,0)e.Anchored=true e.CanCollide=false e.FormFactor=Enum.FormFactor.Custom e.Size=VEC3(.4,10,.4)e.BottomSurface=Enum.SurfaceType.Smooth e.TopSurface=Enum.SurfaceType.Smooth e.Parent=t return t end function DetonateExplosive(t)CreateShockwave(t.Position,S.GrenadeBlastRadius)local E=t.Position local n=Instance.new("\069\120\112\108\111\115\105\111\110")n.BlastPressure=S.GrenadeBlastPressure n.BlastRadius=S.GrenadeBlastRadius n.DestroyJointRadiusPercent=S.GrenadeRangeBasedDamage and 0 or 1 n.ExplosionType=S.GrenadeExplosionType n.Position=E n.Hit:connect(function(t,n)if t.Name=="\084\111\114\115\111"and not t:IsDescendantOf(Character)then if S.GrenadeRangeBasedDamage then local n=nil local e=math.huge for t,S in pairs(t.Parent:GetChildren())do if S:IsA("\066\097\115\101\080\097\114\116")then local t=(E-S.Position).magnitude if t<e then n=S e=t end end end local W=(n.Position-E).unit local g,M=AdvRayCast(E,W,999)local R=g:IsDescendantOf(t.Parent)if S.GrenadeRayCastExplosions and R or not S.GrenadeRayCastExplosions then local E=FindFirstClass(t.Parent,"\072\117\109\097\110\111\105\100")if E and(E.Health>0 and IsEnemy(E))then local t=e/S.GrenadeBlastRadius local n=math.max(1-t,0)local W=n*S.LethalGrenadeDamage local g=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")g.Value=Player g.Name="\099\114\101\097\116\111\114"g.Parent=E E:TakeDamage(W)MarkHit()end end else local E=FindFirstClass(t.Parent,"\072\117\109\097\110\111\105\100")if E and(E.Health>0 and IsEnemy(E))then local t=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")t.Value=Player t.Name="\099\114\101\097\116\111\114"t.Parent=E MarkHit()end end end end)n.Parent=game.Workspace wait()t.Parent:Destroy()end function DetonateSmoke(t)CreateShockwave(t.Position,S.GrenadeEffectRadius)local E=t.Position spawn(function()for t=1,math.floor(S.GrenadeEffectRadius/5)+RAND(5,10),1 do local n=RAND(S.GrenadeEffectRadius*.6,S.GrenadeEffectRadius*.8)local e=RAND(0,S.GrenadeEffectRadius-n)local W,g=RAD(RAND(0,180,10)),RAD(RAND(0,360,10))local M=(CFANG(0,g,0)*CFANG(W,0,0)).lookVector local R=E+M*VEC3(e,e/2,e)local j=Instance.new("\080\097\114\116")j.Transparency=1 j.Name="\083\109\111\107\101"j.Anchored=true j.CanCollide=false j.FormFactor=Enum.FormFactor.Symmetric j.Size=VEC3(1,1,1)j.TopSurface=Enum.SurfaceType.Smooth j.BottomSurface=Enum.SurfaceType.Smooth local I=Instance.new("\083\112\101\099\105\097\108\077\101\115\104")I.MeshType=Enum.MeshType.Sphere I.Scale=VEC3(n,n,n)I.Parent=j j.Parent=Gun_Ignore j.CFrame=CF(R)spawn(function()local t=RAND(.3,.5,.01)for n=0,90,2 do j.CFrame=CF(E:lerp(R,Sine(n)))j.Transparency=NumLerp(1,t,Sine(n))RS:wait()end wait(S.GrenadeEffectTime)for E=0,90,.5 do j.CFrame=CF(R:lerp(R+VEC3(0,20,0),1-COS(RAD(E))))j.Transparency=NumLerp(t,1,Sine(E))RS:wait()end j:Destroy()end)if t%3==0 then RS:wait()end end end)wait()t.Parent:Destroy()end function ThrowGrenade(t)local E=nil if S.TrajectoryAssist then spawn(function()local E=0 local n=t==1 and S.LethalGrenadeThrowVelocity or S.TacticalGrenadeThrowVelocity local e=function(t,E)local e=n*math.cos(t)return e*E end local W=function(t,E)local e=n*math.sin(t)local S=e+-196.2*E return S*E-(-98.1*E)*E end local g=CreateTarget()g.Parent=game.Workspace g.PrimaryPart=g:WaitForChild("\067\101\110\116\101\114")while(Keys[S.LethalGrenadeKey]or Keys[S.TacticalGrenadeKey])and Selected do E=E+math.rad(10)for t,n in pairs(g:GetChildren())do n.Transparency=.2+(math.sin(E)+1)/5 end local t={}local n,S=nil,nil for M=0,10,.1 do local R=e(math.rad(7)-HeadRot,M)local j=W(math.rad(7)-HeadRot,M)if n and S then local e=HRP.CFrame.lookVector local W=((Head.CFrame*CF(1.5,0,0)).p+e*n)+VEC3(0,S,0)local M=((Head.CFrame*CF(1.5,0,0)).p+e*R)+VEC3(0,j,0)local I=CF(W,M)local C=(W-M).magnitude local z=C local q,d=AdvRayCast(W,M-W,1,{Camera;unpack(Ignore)})if q then z=(d-W).magnitude local t=GetHitSurfaceCFrame(d,q)local E=CF(q.CFrame.p,t.p)local n=(E.lookVector*(q.CFrame.p-t.p).magnitude)/2 local e=(d-t.p)+n local S=(E+n)+e g:SetPrimaryPartCFrame(S*CFANG(RAD(-90),0,0))g.Parent=Camera else g.Parent=nil end local H=Instance.new("\080\097\114\116")H.BrickColor=BrickColor.Red()H.Material=Enum.Material.SmoothPlastic H.Transparency=.2+(math.sin(E)+1)/5 H.Anchored=true H.CanCollide=false H.FormFactor=Enum.FormFactor.Custom H.Size=Vector3.new(.4,.4,z)H.TopSurface=Enum.SurfaceType.Smooth H.BottomSurface=Enum.SurfaceType.Smooth H.CFrame=I+(I.lookVector*z)/2 H.Parent=Camera table.insert(t,H)n,S=R,j if q then break end else n,S=R,j end end wait()for t,E in pairs(t)do E:Destroy()end end g:Destroy()end)end local n={function()TweenJoint(LWeld,CF(-1.5,0,0),CF(0,.6,0),Linear,.2)TweenJoint(RWeld,CF(1.5,0,0)*CFANG(0,0,RAD(-10)),CF(0,.6,0),Linear,.2)TweenJoint(Grip,Grip.C0,CFANG(0,RAD(10),0),Linear,.2)wait(.3)end,function()Grip.Part0=Torso Grip.C1=CF(-1,.5,-0.5)if S.LethalGrenadeType==3 and t==1 then E=CreateKnife()E.Parent=Gun_Ignore local t=Instance.new("\087\101\108\100")t.Part0=FakeRArm t.Part1=E t.C0=Grip.C0 t.C1=CF(0,0,-0.5)*CFANG(RAD(90),RAD(90),0)t.Parent=E TweenJoint(LWeld2,CF(),CF(),Sine,.3)TweenJoint(RWeld2,CF(),CF(),Sine,.3)TweenJoint(LWeld,ArmC0[1],CF(0,.5,.1)*CFANG(RAD(90),0,0),Sine,.3)TweenJoint(RWeld,ArmC0[2],CF(0,.4,.1)*CFANG(RAD(-80),0,0),Sine,.3)wait(.3)else E=CreateGrenade()E.Parent=Gun_Ignore local t=Instance.new("\087\101\108\100")t.Part0=FakeRArm t.Part1=E:WaitForChild("\067\101\110\116\101\114")t.C0=Grip.C0 t.Parent=E:WaitForChild("\067\101\110\116\101\114")TweenJoint(LWeld2,CF(),CFANG(0,RAD(80),0),Linear,.25)TweenJoint(RWeld2,CF(),CFANG(0,RAD(-80),0),Linear,.25)TweenJoint(LWeld,ArmC0[1],CF(-0.2,.8,.1)*CFANG(RAD(10),0,RAD(-30)),Linear,.25)TweenJoint(RWeld,ArmC0[2],CF(.2,.8,.1)*CFANG(RAD(10),0,RAD(30)),Linear,.25)wait(.3)end end;function()repeat wait()until not Keys[S.LethalGrenadeKey]and not Keys[S.TacticalGrenadeKey]or not Selected end;function()if S.LethalGrenadeType~=3 or t==2 then TweenJoint(LWeld2,CF(),CFANG(0,RAD(45),0),Sine,.2)TweenJoint(RWeld2,CF(),CFANG(0,RAD(-45),0),Sine,.2)TweenJoint(LWeld,ArmC0[1],CF(0,.8,.1),Sine,.2)TweenJoint(RWeld,ArmC0[2],CF(0,.8,.1),Sine,.2)wait(.2)end end;function()if S.LethalGrenadeType~=3 or t==2 then TweenJoint(LWeld2,CF(),CF(),Sine,.3)TweenJoint(RWeld2,CF(),CF(),Sine,.3)TweenJoint(LWeld,ArmC0[1],CF(0,.5,.1)*CFANG(RAD(90),0,0),Sine,.3)TweenJoint(RWeld,ArmC0[2],CF(0,.4,.1)*CFANG(RAD(-80),0,0),Sine,.3)wait(.3)end end;function()TweenJoint(RWeld,ArmC0[2],CF(0,.8,.1)*CFANG(RAD(-10),0,0),Sine,.1)wait(.07)end,function()local n=nil E:Destroy()if S.LethalGrenadeType==3 and t==1 then local t=CreateKnife()n=t t.Parent=Gun_Ignore n.CFrame=((FakeRArm.CFrame*Grip.C0)*CF(0,.5,0))*CFANG(RAD(-90),0,RAD(90))n.Velocity=n.Velocity+(Head.CFrame*CFANG(RAD(7),0,0)).lookVector*S.LethalGrenadeThrowVelocity n.RotVelocity=(n.CFrame*CFANG(RAD(90),0,0)).lookVector*20 else local E=CreateGrenade()n=E:WaitForChild("\067\101\110\116\101\114")local e=Instance.new("\083\111\117\110\100")e.SoundId=t==1 and S.ExplosionSound or"\114\098\120\097\115\115\101\116\105\100\058\047\047\049\053\054\050\056\051\049\049\054"e.Volume=1 e.PlayOnRemove=true e.Parent=n E.Parent=Gun_Ignore n.CanCollide=true n.CFrame=FakeRArm.CFrame*Grip.C0 if t==1 then n.Velocity=n.Velocity+(Head.CFrame*CFANG(RAD(7),0,0)).lookVector*S.LethalGrenadeThrowVelocity elseif t==2 then n.Velocity=n.Velocity+(Head.CFrame*CFANG(RAD(7),0,0)).lookVector*S.TacticalGrenadeThrowVelocity end end spawn(function()if t==1 then if S.LethalGrenadeType==1 then if S.TimerStartOnHit then local t=false n.Touched:connect(function(E)if IsIgnored(E)or t then return end n.Velocity=n.Velocity/4 t=true wait(S.DetonationTime)DetonateExplosive(n)end)else spawn(function()local t=false n.Touched:connect(function(E)if IsIgnored(E)or t then return end t=true n.Velocity=n.Velocity/4 end)end)wait(S.DetonationTime)DetonateExplosive(n)end elseif S.LethalGrenadeType==2 then local t=false local E=nil n.Touched:connect(function(e)if IsIgnored(e)or t then return end E=n.CFrame local W=Instance.new("\087\101\108\100")W.Name="\083\101\109\116\101\120"W.Part0=n W.Part1=e W.C0=E:toObjectSpace(e.CFrame)W.Parent=n n.ChildRemoved:connect(function(t)if t.Name=="\083\101\109\116\101\120"then local t=Instance.new("\087\101\108\100")t.Name="\083\101\109\116\101\120"t.Part0=n t.Part1=e t.C0=E:toObjectSpace(e.CFrame)t.Parent=n end end)if S.TimerStartOnHit then t=true wait(S.DetonationTime)DetonateExplosive(n)end end)if not S.TimerStartOnHit then wait(S.DetonationTime)t=true DetonateExplosive(n)end elseif S.LethalGrenadeType==3 then local t=false n.Touched:connect(function(E)if IsIgnored(E)or t then return end t=true local e=Instance.new("\087\101\108\100")e.Name="\083\116\105\099\107\121"e.Part0=n e.Part1=E e.C0=n.CFrame:toObjectSpace(E.CFrame)e.Parent=n n.ChildRemoved:connect(function(t)if t.Name=="\083\116\105\099\107\121"then local t=Instance.new("\087\101\108\100")t.Name="\083\116\105\099\107\121"t.Part0=n t.Part1=E t.C0=n.CFrame:toObjectSpace(E.CFrame)t.Parent=n end end)if E then if E.Parent.ClassName=="\072\097\116"then local t=FindFirstClass(E.Parent.Parent,"\072\117\109\097\110\111\105\100")if t and IsEnemy(t)then local E=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")E.Name="\099\114\101\097\116\111\114"E.Value=Player E.Parent=t t:TakeDamage(t.MaxHealth)MarkHit()end else local t=FindFirstClass(E.Parent,"\072\117\109\097\110\111\105\100")if t and IsEnemy(t)then local E=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")E.Name="\099\114\101\097\116\111\114"E.Value=Player E.Parent=t t:TakeDamage(t.MaxHealth)MarkHit()end end end wait(3)n:Destroy()end)end elseif t==2 then if S.TacticalGrenadeType==1 then if S.TimerStartOnHit then local t=false n.Touched:connect(function(E)if IsIgnored(E)or t then return end n.Velocity=n.Velocity/2 t=true wait(S.DetonationTime)DetonateSmoke(n)end)else spawn(function()local t=false n.Touched:connect(function(E)if IsIgnored(E)or t then return end t=true n.Velocity=n.Velocity/2 end)end)wait(S.DetonationTime)DetonateSmoke(n)end end end end)if S.GrenadeTrail and S.GrenadeTrailTransparency~=1 then spawn(function()local t=nil while true do if t then if not n:IsDescendantOf(game)or n.Name=="\075\110\105\102\101"and FindFirstClass(n,"\087\101\108\100")then break end local E=Instance.new("\080\097\114\116")E.BrickColor=S.GrenadeTrailColor E.Transparency=S.GrenadeTrailTransparency E.Anchored=true E.CanCollide=false E.Size=VEC3(1,1,1)local e=Instance.new("\066\108\111\099\107\077\101\115\104")e.Offset=VEC3(0,0,-(n.Position-t).magnitude/2)e.Scale=VEC3(S.GrenadeTrailThickness,S.GrenadeTrailThickness,(n.Position-t).magnitude)e.Parent=E E.Parent=Gun_Ignore E.CFrame=CF(t,n.Position)delay(S.GrenadeTrailVisibleTime,function()if S.GrenadeTrailDisappearTime>0 then local t=0 while true do if t==90 then break end if not Selected then break end local n=t+1.5/S.GrenadeTrailDisappearTime t=n>90 and 90 or n local e=t/90 E.Transparency=NumLerp(S.GrenadeTrailTransparency,1,e)RS:wait()end E:Destroy()else E:Destroy()end end)t=n.Position else t=n.Position end RS:wait()end end)end wait(.2)end,function()TweenJoint(RWeld,CF(1.5,0,0)*CFANG(0,0,RAD(-10)),CF(0,.6,0),Linear,.2)wait(.3)end,function()Grip.Part0=RArm Grip.C1=CFANG(0,RAD(20),0)TweenJoint(LWeld,ArmC0[1],S.ArmC1_UnAimed.Left,Linear,.2)TweenJoint(RWeld,ArmC0[2],S.ArmC1_UnAimed.Right,Linear,.2)wait(.2)end}for t,E in pairs(n)do if not Selected then break end E()end if not Selected and E then E:Destroy()end end


function CreateGrenade()
	local Grenade = Instance.new("Model")
	
	local Center = Instance.new("Part")
	Center.BrickColor = S.GrenadeColor
	Center.Name = "Center"
	Center.CanCollide = false
	Center.Elasticity = 0
	Center.FormFactor = Enum.FormFactor.Custom
	Center.Size = S.GrenadeSize
	Center.BottomSurface = Enum.SurfaceType.Smooth
	Center.TopSurface = Enum.SurfaceType.Smooth
	Center.Parent = Grenade
	
	local Mesh1 = Instance.new("SpecialMesh")
	Mesh1.MeshType = Enum.MeshType.Sphere
	Mesh1.Parent = Center
	
	return Grenade
end

function CreateKnife()
	local Knife = Instance.new("Part")
	Knife.BrickColor = S.GrenadeColor
	Knife.Name = "Knife"
	Knife.CanCollide = false
	Knife.FormFactor = Enum.FormFactor.Custom
	Knife.Size = VEC3(1, 1, 3)
	
	local Mesh = Instance.new("SpecialMesh")
	Mesh.MeshId = "http://www.roblox.com/asset/?id=12221720"
	Mesh.MeshType = Enum.MeshType.FileMesh
	Mesh.Scale = VEC3(0.5, 0.5, 0.5)
	Mesh.Parent = Knife
	
	return Knife
end

function CreateTarget()
	local Target = Instance.new("Model")
	
	local Center = Instance.new("Part")
	Center.BrickColor = BrickColor.new("Bright red")
	Center.Material = Enum.Material.SmoothPlastic
	Center.Transparency = 0.3
	Center.Name = "Center"
	Center.Anchored = true
	Center.CanCollide = false
	Center.FormFactor = Enum.FormFactor.Custom
	Center.Size = VEC3(4, 0.2, 4)
	Center.Parent = Target
	local CylinderMesh = Instance.new("CylinderMesh")
	CylinderMesh.Parent = Center
	
	local Line = Instance.new("Part")
	Line.BrickColor = BrickColor.new("Bright red")
	Line.Transparency = 0.3
	Line.Name = "Line"
	Line.CFrame = Center.CFrame * CFrame.new(0, 5.1, 0)
	Line.Anchored = true
	Line.CanCollide = false
	Line.FormFactor = Enum.FormFactor.Custom
	Line.Size = VEC3(0.4, 10, 0.4)
	Line.BottomSurface = Enum.SurfaceType.Smooth
	Line.TopSurface = Enum.SurfaceType.Smooth
	Line.Parent = Target
	
	return Target
end

function DetonateExplosive(Grenade)
	CreateShockwave(Grenade.Position, S.GrenadeBlastRadius)
	local GrenadePos = Grenade.Position
	local E = Instance.new("Explosion")
	E.BlastPressure = S.GrenadeBlastPressure
	E.BlastRadius = S.GrenadeBlastRadius
	E.DestroyJointRadiusPercent = (S.GrenadeRangeBasedDamage and 0 or 1)
	E.ExplosionType = S.GrenadeExplosionType
	E.Position = GrenadePos
	E.Hit:connect(function(HObj, HDist)
		if HObj.Name == "Torso" and (not HObj:IsDescendantOf(Character)) then
			if S.GrenadeRangeBasedDamage then
				local ClosestPart = nil
				local ClosestDist = math.huge
				
				for _, P in pairs(HObj.Parent:GetChildren()) do
					if P:IsA("BasePart") then
						local Dist = (GrenadePos - P.Position).magnitude
						if Dist < ClosestDist then
							ClosestPart = P
							ClosestDist = Dist
						end
					end
				end
				
				local Dir = (ClosestPart.Position - GrenadePos).unit
				local H, P = AdvRayCast(GrenadePos, Dir, 999)
				local RayHitHuman = H:IsDescendantOf(HObj.Parent)
				if (S.GrenadeRayCastExplosions and RayHitHuman) or (not S.GrenadeRayCastExplosions) then
					local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
					if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
						local DistFactor = ClosestDist / S.GrenadeBlastRadius
						local DistInvert = math.max(1 - DistFactor,0)
						local NewDamage = DistInvert * S.LethalGrenadeDamage
						
						local CreatorTag = Instance.new("ObjectValue")
						CreatorTag.Value = Player
						CreatorTag.Name = "creator"
						CreatorTag.Parent = HitHumanoid
						HitHumanoid:TakeDamage(NewDamage)
						MarkHit()
					end
				end
			else
				local HitHumanoid = FindFirstClass(HObj.Parent, "Humanoid")
				if HitHumanoid and HitHumanoid.Health > 0 and IsEnemy(HitHumanoid) then
					local CreatorTag = Instance.new("ObjectValue")
					CreatorTag.Value = Player
					CreatorTag.Name = "creator"
					CreatorTag.Parent = HitHumanoid
					MarkHit()
				end
			end
		end
	end)
	E.Parent = game.Workspace
	
	wait()
	
	Grenade.Parent:Destroy()
end

function DetonateSmoke(Grenade)
	CreateShockwave(Grenade.Position, S.GrenadeEffectRadius)
	local GrenadePos = Grenade.Position
	
	spawn(function()
		for i = 1, math.floor(S.GrenadeEffectRadius / 5) + RAND(5, 10) do
			local Size = RAND(S.GrenadeEffectRadius * 0.6, S.GrenadeEffectRadius * 0.8)
			local Dist = RAND(0, S.GrenadeEffectRadius - Size)
			local XRot, YRot = RAD(RAND(0, 180, 10)), RAD(RAND(0, 360, 10))
			local RotLV = (CFANG(0, YRot, 0) * CFANG(XRot, 0, 0)).lookVector
			local Pos = GrenadePos + (RotLV * VEC3(Dist, Dist / 2, Dist))
			
			local Smoke = Instance.new("Part")
			Smoke.Transparency = 1
			Smoke.Name = "Smoke"
			Smoke.Anchored = true
			Smoke.CanCollide = false
			Smoke.FormFactor = Enum.FormFactor.Symmetric
			Smoke.Size = VEC3(1, 1, 1)
			Smoke.TopSurface = Enum.SurfaceType.Smooth
			Smoke.BottomSurface = Enum.SurfaceType.Smooth
			
			local Mesh = Instance.new("SpecialMesh")
			Mesh.MeshType = Enum.MeshType.Sphere
			Mesh.Scale = VEC3(Size, Size, Size)
			Mesh.Parent = Smoke
			
			Smoke.Parent = Gun_Ignore
			Smoke.CFrame = CF(Pos)
			
			spawn(function()
				local Trans = RAND(0.3, 0.5, 0.01)
				for X = 0, 90, 2 do
					Smoke.CFrame = CF(GrenadePos:lerp(Pos, Sine(X)))
					Smoke.Transparency = NumLerp(1, Trans, Sine(X))
					RS:wait()
				end
				
				wait(S.GrenadeEffectTime)
				
				for X = 0, 90, 0.5 do
					Smoke.CFrame = CF(Pos:lerp(Pos + VEC3(0, 20, 0), 1 - COS(RAD(X))))
					Smoke.Transparency = NumLerp(Trans, 1, Sine(X))
					RS:wait()
				end
				
				Smoke:Destroy()
			end)
			
			if i % 3 == 0 then
				RS:wait()
			end
		end
	end)
	
	wait()
	
	Grenade.Parent:Destroy()
end

function ThrowGrenade(Type)
	local Grenade0 = nil
	if S.TrajectoryAssist then
		spawn(function()
			local X = 0
			local Vel = (Type == 1 and S.LethalGrenadeThrowVelocity or S.TacticalGrenadeThrowVelocity)
			
			local GetX = function(Ang, T)
				local Vx = Vel * math.cos(Ang)
				return Vx * T
			end
			
			local GetY = function(Ang, T)
				local V0y = Vel * math.sin(Ang)
				local Vy = V0y + (-196.2 * T)
				return (Vy * T) - (-98.1 * T * T)
			end
			
			local Target = CreateTarget()
			Target.Parent = game.Workspace
			Target.PrimaryPart = Target:WaitForChild("Center")
			
			while (Keys[S.LethalGrenadeKey] or Keys[S.TacticalGrenadeKey]) and Selected do
				X = X + math.rad(10)
				for _,v in pairs(Target:GetChildren()) do
					v.Transparency = 0.2 + ((math.sin(X) + 1) / 5)
				end
				
				local Lines = {}
				local LastX, LastY = nil, nil
				for T = 0, 10, 0.1 do
					local XPos = GetX(math.rad(7) - HeadRot, T)
					local YPos = GetY(math.rad(7) - HeadRot, T)
					if LastX and LastY then
						local LookV3 = HRP.CFrame.lookVector
						local LastPos = (Head.CFrame * CF(1.5, 0, 0)).p + (LookV3 * LastX) + VEC3(0, LastY, 0)
						local NewPos = (Head.CFrame * CF(1.5, 0, 0)).p + (LookV3 * XPos) + VEC3(0, YPos, 0)
						local LineCF = CF(LastPos, NewPos)
						local Dist = (LastPos - NewPos).magnitude
						local NewDist = Dist
						
						local H, P = AdvRayCast(LastPos, (NewPos - LastPos), 1, {Camera, unpack(Ignore)})
						if H then
							NewDist = (P - LastPos).magnitude
							
							local SurfaceCF = GetHitSurfaceCFrame(P, H)
							local SurfaceDir = CF(H.CFrame.p, SurfaceCF.p)
							local SurfaceDist = SurfaceDir.lookVector * (H.CFrame.p - SurfaceCF.p).magnitude / 2
							local SurfaceOffset = P - SurfaceCF.p + SurfaceDist
							local SurfaceCFrame = SurfaceDir + SurfaceDist + SurfaceOffset
							
							Target:SetPrimaryPartCFrame(SurfaceCFrame * CFANG(RAD(-90), 0, 0))
							
							Target.Parent = Camera
						else
							Target.Parent = nil
						end
						
						local Line = Instance.new("Part")
						Line.BrickColor = BrickColor.Red()
						Line.Material = Enum.Material.SmoothPlastic
						Line.Transparency = 0.2 + ((math.sin(X) + 1) / 5)
						Line.Anchored = true
						Line.CanCollide = false
						Line.FormFactor = Enum.FormFactor.Custom
						Line.Size = Vector3.new(0.4, 0.4, NewDist)
						Line.TopSurface = Enum.SurfaceType.Smooth
						Line.BottomSurface = Enum.SurfaceType.Smooth
						Line.CFrame = LineCF + (LineCF.lookVector * NewDist / 2)
						Line.Parent = Camera
						
						table.insert(Lines, Line)
						
						LastX,LastY = XPos,YPos
						
						if H then break end
					else
						LastX,LastY = XPos,YPos
					end
				end
				
				wait()
				
				for _,Line in pairs(Lines) do
					Line:Destroy()
				end
			end
			
			Target:Destroy()
		end)
	end
	
	local AnimTable = {
		function()
			TweenJoint(LWeld, CF(-1.5, 0, 0), CF(0, 0.6, 0), Linear, 0.2)
			TweenJoint(RWeld, CF(1.5, 0, 0) * CFANG(0, 0, RAD(-10)), CF(0, 0.6, 0), Linear, 0.2)
			TweenJoint(Grip, Grip.C0, CFANG(0, RAD(10), 0), Linear, 0.2)
			wait(0.3)
		end;
	
		function()
			Grip.Part0 = Torso
			Grip.C1 = CF(-1, 0.5, -0.5)
			
			if S.LethalGrenadeType == 3 and Type == 1 then
				Grenade0 = CreateKnife()
				Grenade0.Parent = Gun_Ignore
				
				local Weld = Instance.new("Weld")
				Weld.Part0 = FakeRArm
				Weld.Part1 = Grenade0
				Weld.C0 = Grip.C0
				Weld.C1 = CF(0, 0, -0.5) * CFANG(RAD(90), RAD(90), 0)
				Weld.Parent = Grenade0
				
				TweenJoint(LWeld2, CF(), CF(), Sine, 0.3)
				TweenJoint(RWeld2, CF(), CF(), Sine, 0.3)
				TweenJoint(LWeld, ArmC0[1], CF(0, 0.5, 0.1) * CFANG(RAD(90), 0, 0), Sine, 0.3)
				TweenJoint(RWeld, ArmC0[2], CF(0, 0.4, 0.1) * CFANG(RAD(-80), 0, 0), Sine, 0.3)
				wait(0.3)
			else
				Grenade0 = CreateGrenade()
				Grenade0.Parent = Gun_Ignore
				
				local Weld = Instance.new("Weld")
				Weld.Part0 = FakeRArm
				Weld.Part1 = Grenade0:WaitForChild("Center")
				Weld.C0 = Grip.C0
				Weld.Parent = Grenade0:WaitForChild("Center")
				
				TweenJoint(LWeld2, CF(), CFANG(0, RAD(80), 0), Linear, 0.25)
				TweenJoint(RWeld2, CF(), CFANG(0, RAD(-80), 0), Linear, 0.25)
				TweenJoint(LWeld, ArmC0[1], CF(-0.2, 0.8, 0.1) * CFANG(RAD(10), 0, RAD(-30)), Linear, 0.25)
				TweenJoint(RWeld, ArmC0[2], CF(0.2, 0.8, 0.1) * CFANG(RAD(10), 0, RAD(30)), Linear, 0.25)
				wait(0.3)
			end
		end;
	
		function()
			repeat wait() until (not Keys[S.LethalGrenadeKey]) and (not Keys[S.TacticalGrenadeKey]) or (not Selected)
		end;
	
		function()
			if S.LethalGrenadeType ~= 3 or Type == 2 then
				TweenJoint(LWeld2, CF(), CFANG(0, RAD(45), 0), Sine, 0.2)
				TweenJoint(RWeld2, CF(), CFANG(0, RAD(-45), 0), Sine, 0.2)
				TweenJoint(LWeld, ArmC0[1], CF(0, 0.8, 0.1), Sine, 0.2)
				TweenJoint(RWeld, ArmC0[2], CF(0, 0.8, 0.1), Sine, 0.2)
				wait(0.2)
			end
		end;
	
		function()
			if S.LethalGrenadeType ~= 3 or Type == 2 then
				TweenJoint(LWeld2, CF(), CF(), Sine, 0.3)
				TweenJoint(RWeld2, CF(), CF(), Sine, 0.3)
				TweenJoint(LWeld, ArmC0[1], CF(0, 0.5, 0.1) * CFANG(RAD(90), 0, 0), Sine, 0.3)
				TweenJoint(RWeld, ArmC0[2], CF(0, 0.4, 0.1) * CFANG(RAD(-80), 0, 0), Sine, 0.3)
				wait(0.3)
			end
		end;
	
		function()
			TweenJoint(RWeld, ArmC0[2], CF(0, 0.8, 0.1) * CFANG(RAD(-10), 0, 0), Sine, 0.1)
			wait(0.07)
		end;
	
		function()
			local Main = nil
			Grenade0:Destroy()
			
			if S.LethalGrenadeType == 3 and Type == 1 then
				local Grenade1 = CreateKnife()
				Main = Grenade1
				
				Grenade1.Parent = Gun_Ignore
				
				Main.CFrame = FakeRArm.CFrame * Grip.C0 * CF(0, 0.5, 0) * CFANG(RAD(-90), 0, RAD(90))
				Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.LethalGrenadeThrowVelocity)
				Main.RotVelocity = (Main.CFrame * CFANG(RAD(90), 0, 0)).lookVector * 20
			else
				local Grenade1 = CreateGrenade()
				Main = Grenade1:WaitForChild("Center")
				
				local Sound = Instance.new("Sound")
				Sound.SoundId = (Type == 1 and S.ExplosionSound or "rbxassetid://156283116")
				Sound.Volume = 1
				Sound.PlayOnRemove = true
				Sound.Parent = Main
				
				Grenade1.Parent = Gun_Ignore
				
				Main.CanCollide = true
				Main.CFrame = FakeRArm.CFrame * Grip.C0
				if Type == 1 then
					Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.LethalGrenadeThrowVelocity)
				elseif Type == 2 then
					Main.Velocity = Main.Velocity + ((Head.CFrame * CFANG(RAD(7), 0, 0)).lookVector * S.TacticalGrenadeThrowVelocity)
				end
			end
			
			spawn(function()
				if Type == 1 then
					if S.LethalGrenadeType == 1 then
						if S.TimerStartOnHit then
							local Detonated = false
							Main.Touched:connect(function(Obj)
								if IsIgnored(Obj) or Detonated then return end
								Main.Velocity = Main.Velocity / 4
								Detonated = true
								
								wait(S.DetonationTime)
								
								DetonateExplosive(Main)
							end)
						else
							spawn(function()
								local Touched = false
								Main.Touched:connect(function(Obj)
									if IsIgnored(Obj) or Touched then return end
									Touched = true
									Main.Velocity = Main.Velocity / 4
								end)
							end)
							wait(S.DetonationTime)
							DetonateExplosive(Main)
						end
					elseif S.LethalGrenadeType == 2 then
						local Detonated = false
						local GrenadeCF = nil
						Main.Touched:connect(function(Obj)
							if IsIgnored(Obj) or Detonated then return end
							GrenadeCF = Main.CFrame
							
							local W = Instance.new("Weld")
							W.Name = "Semtex"
							W.Part0 = Main
							W.Part1 = Obj
							W.C0 = GrenadeCF:toObjectSpace(Obj.CFrame)
							W.Parent = Main
							
							Main.ChildRemoved:connect(function(C)
								if C.Name == "Semtex" then
									local W = Instance.new("Weld")
									W.Name = "Semtex"
									W.Part0 = Main
									W.Part1 = Obj
									W.C0 = GrenadeCF:toObjectSpace(Obj.CFrame)
									W.Parent = Main
								end
							end)
							
							if S.TimerStartOnHit then
								Detonated = true
								wait(S.DetonationTime)
								DetonateExplosive(Main)
							end
						end)
						
						if (not S.TimerStartOnHit) then
							wait(S.DetonationTime)
							Detonated = true
							DetonateExplosive(Main)
						end
					elseif S.LethalGrenadeType == 3 then
						local Touched = false
						Main.Touched:connect(function(Obj)
							if IsIgnored(Obj) or Touched then return end
							Touched = true
							
							local W = Instance.new("Weld")
							W.Name = "Sticky"
							W.Part0 = Main
							W.Part1 = Obj
							W.C0 = Main.CFrame:toObjectSpace(Obj.CFrame)
							W.Parent = Main
							
							Main.ChildRemoved:connect(function(C)
								if C.Name == "Sticky" then
									local W = Instance.new("Weld")
									W.Name = "Sticky"
									W.Part0 = Main
									W.Part1 = Obj
									W.C0 = Main.CFrame:toObjectSpace(Obj.CFrame)
									W.Parent = Main
								end
							end)
							
							if Obj then
								if Obj.Parent.ClassName == "Hat" then
									local HitHumanoid = FindFirstClass(Obj.Parent.Parent, "Humanoid")
									if HitHumanoid and IsEnemy(HitHumanoid) then
										local CreatorTag = Instance.new("ObjectValue")
										CreatorTag.Name = "creator"
										CreatorTag.Value = Player
										CreatorTag.Parent = HitHumanoid
										HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
										MarkHit()
									end
								else
									local HitHumanoid = FindFirstClass(Obj.Parent, "Humanoid")
									if HitHumanoid and IsEnemy(HitHumanoid) then
										local CreatorTag = Instance.new("ObjectValue")
										CreatorTag.Name = "creator"
										CreatorTag.Value = Player
										CreatorTag.Parent = HitHumanoid
										HitHumanoid:TakeDamage(HitHumanoid.MaxHealth)
										MarkHit()
									end
								end
							end
							
							wait(3)
							
							Main:Destroy()
						end)
					end
				elseif Type == 2 then
					if S.TacticalGrenadeType == 1 then
						if S.TimerStartOnHit then
							local Detonated = false
							Main.Touched:connect(function(Obj)
								if IsIgnored(Obj) or Detonated then return end
								Main.Velocity = Main.Velocity / 2
								Detonated = true
								
								wait(S.DetonationTime)
								
								DetonateSmoke(Main)
							end)
						else
							spawn(function()
								local Touched = false
								Main.Touched:connect(function(Obj)
									if IsIgnored(Obj) or Touched then return end
									Touched = true
									Main.Velocity = Main.Velocity / 2
								end)
							end)
							wait(S.DetonationTime)
							DetonateSmoke(Main)
						end
					end
				end
			end)
			
			if S.GrenadeTrail and S.GrenadeTrailTransparency ~= 1 then
				spawn(function()
					local LastPos = nil
					while true do
						if LastPos then
							if (not Main:IsDescendantOf(game))
							or (Main.Name == "Knife" and FindFirstClass(Main, "Weld")) then
								break
							end
							local Trail = Instance.new("Part")
							Trail.BrickColor = S.GrenadeTrailColor
							Trail.Transparency = S.GrenadeTrailTransparency
							Trail.Anchored = true
							Trail.CanCollide = false
							Trail.Size = VEC3(1, 1, 1)
							local Mesh = Instance.new("BlockMesh")
							Mesh.Offset = VEC3(0, 0, -(Main.Position - LastPos).magnitude / 2)
							Mesh.Scale = VEC3(S.GrenadeTrailThickness, S.GrenadeTrailThickness, (Main.Position - LastPos).magnitude)
							Mesh.Parent = Trail
							Trail.Parent = Gun_Ignore
							Trail.CFrame = CF(LastPos, Main.Position)
							delay(S.GrenadeTrailVisibleTime, function()
								if S.GrenadeTrailDisappearTime > 0 then
									local X = 0
									while true do
										if X == 90 then break end
										if (not Selected) then break end
										local NewX = X + (1.5 / S.GrenadeTrailDisappearTime)
										X = (NewX > 90 and 90 or NewX)
										local Alpha = X / 90
										Trail.Transparency = NumLerp(S.GrenadeTrailTransparency, 1, Alpha)
										RS:wait()
									end
									Trail:Destroy()
								else
									Trail:Destroy()
								end
							end)
							LastPos = Main.Position
						else
							LastPos = Main.Position
						end
						RS:wait()
					end
				end)
			end
			wait(0.2)
		end;
	
		function()
			TweenJoint(RWeld, CF(1.5, 0, 0) * CFANG(0, 0, RAD(-10)), CF(0, 0.6, 0), Linear, 0.2)
			wait(0.3)
		end;
	
		function()
			Grip.Part0 = RArm
			Grip.C1 = CFANG(0, RAD(20), 0)
			
			TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Linear, 0.2)
			TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Linear, 0.2)
			wait(0.2)
		end;
	}
	
	for _,F in pairs(AnimTable) do
		if (not Selected) then
			break
		end
		F()
	end
	
	if (not Selected) and Grenade0 then
		Grenade0:Destroy()
	end
end
