--Explodes the rocket at the given position.

local function Explode(Position)
	if Exploded == false then
		Exploded = true		
		local RegisteredPlayers = {}
		
		--Returns the amount of hit players.
		local function GetHitPlayers()
			local Count = 0
			for _,_ in pairs(RegisteredPlayers) do
				Count = Count + 1
			end
			
			return Count
		end
		
		--Regester hits from exploisions.
		local function OnExplosionHit(ExplosionTouchPart,RadiusFromBlast)
			local IsInCharacter = false
			
			if ExplosionTouchPart.Size.magnitude/2 < 20 then
				local BreakJoints = true
				local HitCharacter,HitHumanoid = FindCharacterAncestor(ExplosionTouchPart)
				
				--Damage the character if one exists and disable breaking joints.
				if HitCharacter then
					IsInCharacter = true			
					BreakJoints = false
							
					local HitPlayer = game.Players:GetPlayerFromCharacter(HitCharacter)
					if (HitPlayer and not RegisteredPlayers[HitPlayer]) or (not HitPlayer and not RegisteredPlayers[HitCharacter]) then
						RegisteredPlayers[HitPlayer or HitCharacter] = true
						