local function y(y,C)local e=game.Players.LocalPlayer.Character local E=Handle.Position+Handle.CFrame.lookVector*(Handle.Size.Z/2)local c=y:FindFirstChild("\066\111\100\121\086\101\108\111\099\105\116\121")local s=y:FindFirstChild("\066\111\100\121\071\121\114\111")local O=y:FindFirstChild("\069\120\112\108\111\100\101")y.Velocity=Vector3.new(0,0,0)y.CFrame=CFrame.new(E,C)if c and s then local y=(C-E).unit c.Velocity=y*ROCKET_LAUNCH_SPEED s.CFrame=CFrame.new(Vector3.new(0,0,0),y)end if O then y.Touched:Connect(function(C)if not IGNORE_LIST[string.lower(C.Name)]and not C:IsDescendantOf(e)then O:FireServer(y.Position)end end)end end
--Launches a rocket.
local function LaunchRocket(Rocket, TargetPos)
	local Character = game.Players.LocalPlayer.Character
	local SpawnPosition = Handle.Position + (Handle.CFrame.lookVector * (Handle.Size.Z / 2))
	local BodyVelocity = Rocket:FindFirstChild("BodyVelocity")
	local BodyGyro = Rocket:FindFirstChild("BodyGyro")
	local ExplodeEvent = Rocket:FindFirstChild("Explode")
	Rocket.Velocity = Vector3.new(0, 0, 0)
	Rocket.CFrame = CFrame.new(SpawnPosition, TargetPos)

	--Set the velocity and direction.
	if BodyVelocity and BodyGyro then
		local Direction = (TargetPos - SpawnPosition).unit
		BodyVelocity.Velocity = Direction * ROCKET_LAUNCH_SPEED
		BodyGyro.CFrame = CFrame.new(Vector3.new(0, 0, 0), Direction)
	end

	--Fire the event when touched.
	if ExplodeEvent then
		Rocket.Touched:Connect(function(TouchPart)
			if not IGNORE_LIST[string.lower(TouchPart.Name)] and not TouchPart:IsDescendantOf(Character) then
				ExplodeEvent:FireServer(Rocket.Position)
			end
		end)
	end
end
